mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This reverts commit 767b49232e.
If anything else (e.g. GTM integration) introduces a nonce/hash, then this change stops the splash screen JS to fail and makes sites unusable.
This commit is contained in:
@@ -35,25 +35,6 @@ RSpec.describe ContentSecurityPolicy::Builder do
|
||||
|
||||
expect(builder.build).to eq(previous)
|
||||
end
|
||||
|
||||
it "omits nonce when unsafe-inline enabled" do
|
||||
builder << { script_src: %w['unsafe-inline' 'nonce-abcde'] }
|
||||
|
||||
expect(builder.build).not_to include("nonce-abcde")
|
||||
end
|
||||
|
||||
it "omits sha when unsafe-inline enabled" do
|
||||
builder << { script_src: %w['unsafe-inline' 'sha256-abcde'] }
|
||||
|
||||
expect(builder.build).not_to include("sha256-abcde")
|
||||
end
|
||||
|
||||
it "keeps sha and nonce when unsafe-inline is not specified" do
|
||||
builder << { script_src: %w['nonce-abcde' 'sha256-abcde'] }
|
||||
|
||||
expect(builder.build).to include("nonce-abcde")
|
||||
expect(builder.build).to include("sha256-abcde")
|
||||
end
|
||||
end
|
||||
|
||||
def parse(csp_string)
|
||||
|
||||
Reference in New Issue
Block a user