Skip to content

Commit

Permalink
make test demonstrate combining policies
Browse files Browse the repository at this point in the history
  • Loading branch information
oreoshake committed Aug 17, 2015
1 parent de5add4 commit 8a77f47
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -64,8 +64,9 @@ def request_for user_agent, request_uri=nil, options={:ssl => false}

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

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

0 comments on commit 8a77f47

Please sign in to comment.