Skip to content

Commit 248dcf2

Browse files
committed
wrap the configs in an array, ensure config is valid
1 parent 1be7d00 commit 248dcf2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/lib/secure_headers/headers/content_security_policy_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ module SecureHeaders
138138
}.freeze
139139
end
140140
non_default_source_additions = CSP::NON_DEFAULT_SOURCES.each_with_object({}) do |directive, hash|
141-
hash[directive] = "http://example.org"
141+
hash[directive] = %w("http://example.org)
142142
end
143143
combined_config = CSP.combine_policies(Configuration.get.csp, non_default_source_additions)
144144

145145
CSP::NON_DEFAULT_SOURCES.each do |directive|
146-
expect(combined_config[directive]).to eq("http://example.org")
146+
expect(combined_config[directive]).to eq(%w("http://example.org))
147147
end
148+
149+
ContentSecurityPolicy.new(combined_config, USER_AGENTS[:firefox]).value
148150
end
149151

150152
it "overrides the report_only flag" do

0 commit comments

Comments
 (0)