Skip to content

Commit 0c72911

Browse files
committed
ONLY dup if the hash is actuall frozen
1 parent 5c3f928 commit 0c72911

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/secure_headers/headers/content_security_policy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def combine_policies(original, additions)
210210
raise ContentSecurityPolicyConfigError.new("Attempted to override an opt-out CSP config.")
211211
end
212212

213-
original = original.dup # in case the hash is frozen
213+
original = original.dup if original.frozen?
214214

215215
# in case we would be appending to an empty directive, fill it with the default-src value
216216
additions.keys.each do |directive|

0 commit comments

Comments
 (0)