Skip to content

Commit

Permalink
Add :report_uri to list of directives
Browse files Browse the repository at this point in the history
- closes #141
  • Loading branch information
oreoshake committed Apr 30, 2015
1 parent 8d2ae5b commit f5dcfb8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/secure_headers/headers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ module Constants
:reflected_xss
]

ALL_DIRECTIVES = DIRECTIVES + NON_DEFAULT_SOURCES
OTHER = [
:report_uri
]

SOURCE_DIRECTIVES = DIRECTIVES + NON_DEFAULT_SOURCES

ALL_DIRECTIVES = DIRECTIVES + NON_DEFAULT_SOURCES + OTHER
end
include Constants

Expand Down Expand Up @@ -102,7 +108,7 @@ def initialize(config=nil, options={})
@config = config.inject({}) do |hash, (key, value)|
config_val = value.respond_to?(:call) ? value.call : value

if ALL_DIRECTIVES.include?(key) # directives need to be normalized to arrays of strings
if SOURCE_DIRECTIVES.include?(key) # directives need to be normalized to arrays of strings
config_val = config_val.split if config_val.is_a? String
if config_val.is_a?(Array)
config_val = config_val.map do |val|
Expand Down

0 comments on commit f5dcfb8

Please sign in to comment.