Skip to content

Commit ca84335

Browse files
keithamusdgreif
authored andcommitted
fix: allow URIs with schema to have trailing slashes normalised
Co-authored-by: Dusty Greif <[email protected]>
1 parent 322c11d commit ca84335

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ module SecureHeaders
5050

5151
it "normalizes source expressions that end with a trailing /" do
5252
config = {
53-
default_src: %w(a.example.org/ b.example.com/ c.example.net/foo/ b.example.co/bar)
53+
default_src: %w(a.example.org/ b.example.com/ wss://c.example.com/ c.example.net/foo/ b.example.co/bar wss://b.example.co/)
5454
}
5555
csp = ContentSecurityPolicy.new(config)
56-
expect(csp.value).to eq("default-src a.example.org b.example.com c.example.net/foo/ b.example.co/bar")
56+
expect(csp.value).to eq("default-src a.example.org b.example.com wss://c.example.com c.example.net/foo/ b.example.co/bar wss://b.example.co")
5757
end
5858

5959
it "does not minify source expressions based on overlapping wildcards" do

0 commit comments

Comments
 (0)