Skip to content

Commit 8a77f47

Browse files
committed
make test demonstrate combining policies
1 parent de5add4 commit 8a77f47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ def request_for user_agent, request_uri=nil, options={:ssl => false}
6464

6565
it "imports JSON to build a policy" do
6666
json1 = %({"default-src":["https:"],"script-src":["'unsafe-inline'","'unsafe-eval'","https:","data:"]})
67-
json2 = %({"style-src":["'unsafe-inline'","https:","about:"],"img-src":["https:","data:"]})
68-
config = ContentSecurityPolicy.from_json(json1, json2)
67+
json2 = %({"style-src":["'unsafe-inline'"],"img-src":["https:","data:"]})
68+
json3 = %({"style-src":["https:","about:"]})
69+
config = ContentSecurityPolicy.from_json(json1, json2, json3)
6970
policy = ContentSecurityPolicy.new(config.merge(:disable_fill_missing => true))
7071

7172
expected = %({"default-src":["https:"],"script-src":["'unsafe-inline'","'unsafe-eval'","https:","data:"],"style-src":["'unsafe-inline'","https:","about:"],"img-src":["https:","data:"]})

0 commit comments

Comments
 (0)