File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,12 @@ module SecureHeaders
4848 expect ( csp . value ) . to eq ( "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:" )
4949 end
5050
51- it "minifies source expressions based on overlapping wildcards" do
51+ it "does not minify source expressions based on overlapping wildcards" do
5252 config = {
5353 default_src : %w( a.example.org b.example.org *.example.org https://*.example.org )
5454 }
5555 csp = ContentSecurityPolicy . new ( config )
56- expect ( csp . value ) . to eq ( "default-src *.example.org" )
56+ expect ( csp . value ) . to eq ( "default-src a.example.org b.example.org *.example.org" )
5757 end
5858
5959 it "removes http/s schemes from hosts" do
@@ -106,8 +106,8 @@ module SecureHeaders
106106 expect ( csp . value ) . to eq ( "default-src *.example.org:*" )
107107 end
108108
109- it "deduplicates any source expressions" do
110- csp = ContentSecurityPolicy . new ( default_src : %w( example.org example.org example.org ) )
109+ it "deduplicates source expressions that match exactly (after scheme stripping) " do
110+ csp = ContentSecurityPolicy . new ( default_src : %w( example.org https:// example.org example.org ) )
111111 expect ( csp . value ) . to eq ( "default-src example.org" )
112112 end
113113
You can’t perform that action at this time.
0 commit comments