File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,8 @@ def build_directive(directive_name)
313313 end
314314
315315 # remove schemes and dedup source expressions
316- dedup_source_list ( strip_source_schemes ( source_list ) ) . join ( " " )
316+ source_list = strip_source_schemes ( source_list ) unless directive_name == REPORT_URI
317+ dedup_source_list ( source_list ) . join ( " " )
317318 end
318319 [ symbol_to_hyphen_case ( directive_name ) , value ] . join ( " " )
319320 end
Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ module SecureHeaders
8585 expect ( csp . value ) . to eq ( "default-src example.org" )
8686 end
8787
88+ it "does not remove schemes from report-uri values" do
89+ csp = ContentSecurityPolicy . new ( default_src : %w( https: ) , report_uri : %w( https://example.org ) )
90+ expect ( csp . value ) . to eq ( "default-src https:; report-uri https://example.org" )
91+ end
92+
8893 it "removes nil from source lists" do
8994 csp = ContentSecurityPolicy . new ( default_src : [ "https://example.org" , nil ] )
9095 expect ( csp . value ) . to eq ( "default-src example.org" )
You can’t perform that action at this time.
0 commit comments