Skip to content

Commit cd73b02

Browse files
committed
Update tests.
1 parent cdb40e5 commit cd73b02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)