Skip to content

Commit ba3cf02

Browse files
authored
make test match others and add tesfor allow-duplicates
1 parent f10a4a4 commit ba3cf02

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ module SecureHeaders
146146
expect(csp.value).to eq("default-src 'self'; require-sri-for script style")
147147
end
148148

149-
it "supports require-trusted-types-for directive" do
149+
it "allows style as a require-trusted-types-src" do
150150
csp = ContentSecurityPolicy.new(default_src: %w('self'), require_trusted_types_for: %w(script))
151151
expect(csp.value).to eq("default-src 'self'; require-trusted-types-for script")
152152
end
@@ -195,6 +195,11 @@ module SecureHeaders
195195
csp = ContentSecurityPolicy.new({trusted_types: %w(blahblahpolicy)})
196196
expect(csp.value).to eq("trusted-types blahblahpolicy")
197197
end
198+
199+
it "allows duplicate policy names in trusted-types directive" do
200+
csp = ContentSecurityPolicy.new({trusted_types: %w(blahblahpolicy 'allow-duplicates')})
201+
expect(csp.value).to eq("trusted-types blahblahpolicy 'allow-duplicates'")
202+
end
198203
end
199204
end
200205
end

0 commit comments

Comments
 (0)