Skip to content

Commit

Permalink
use #opt_out? helper in another location
Browse files Browse the repository at this point in the history
  • Loading branch information
oreoshake committed Aug 17, 2016
1 parent 2a9021c commit 3afd1dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/secure_headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def override_content_security_policy_directives(request, additions, target = nil
def append_content_security_policy_directives(request, additions, target = nil)
config, target = config_and_target(request, target)

if [:both, :enforced].include?(target) && config.csp != OPT_OUT
if [:both, :enforced].include?(target) && !config.csp.opt_out?
config.csp.append(additions)
end

if [:both, :report_only].include?(target) && config.csp_report_only != OPT_OUT
if [:both, :report_only].include?(target) && !config.csp_report_only.opt_out?
config.csp_report_only.append(additions)
end

Expand Down

0 comments on commit 3afd1dd

Please sign in to comment.