aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/content_security_policy.rb
diff options
context:
space:
mode:
authorJeffrey Guenther <guenther.jeffrey@gmail.com>2017-12-08 13:25:54 -0800
committerJeffrey Guenther <guenther.jeffrey@gmail.com>2017-12-08 13:25:54 -0800
commita822287cefc38b9b8b3be38ffd775cd3d511b7c3 (patch)
treed69c6ea1fcc4299caa11bcbef2ce5520347a4f46 /actionpack/lib/action_dispatch/http/content_security_policy.rb
parent08fab27db52aa375df85a23e89799600f785b9d4 (diff)
parentda8e0ba03cbae33857954c0c1a228bd6dae562da (diff)
downloadrails-a822287cefc38b9b8b3be38ffd775cd3d511b7c3.tar.gz
rails-a822287cefc38b9b8b3be38ffd775cd3d511b7c3.tar.bz2
rails-a822287cefc38b9b8b3be38ffd775cd3d511b7c3.zip
Merge branch 'master' into activestorage-guide
Diffstat (limited to 'actionpack/lib/action_dispatch/http/content_security_policy.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/content_security_policy.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/content_security_policy.rb b/actionpack/lib/action_dispatch/http/content_security_policy.rb
index d10d4faf3d..4883e23d24 100644
--- a/actionpack/lib/action_dispatch/http/content_security_policy.rb
+++ b/actionpack/lib/action_dispatch/http/content_security_policy.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require "active_support/core_ext/object/deep_dup"
+
module ActionDispatch #:nodoc:
class ContentSecurityPolicy
class Middleware
@@ -110,7 +112,7 @@ module ActionDispatch #:nodoc:
end
def initialize_copy(other)
- @directives = copy_directives(other.directives)
+ @directives = other.directives.deep_dup
end
DIRECTIVES.each do |name, directive|
@@ -174,10 +176,6 @@ module ActionDispatch #:nodoc:
end
private
- def copy_directives(directives)
- directives.transform_values { |sources| sources.map(&:dup) }
- end
-
def apply_mappings(sources)
sources.map do |source|
case source