diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-12-19 23:39:17 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-12-19 23:39:17 -0700 |
commit | c437a98acaf759d53a85151947709f5efe499a27 (patch) | |
tree | 05e99018b7ce52b47c4ec11f470f95d5831f6a75 /actionpack/lib | |
parent | 0516841968fd9d4a8e94771abb6caa44593ac469 (diff) | |
parent | e8572cf2f94872d81e7145da31d55c6e1b074247 (diff) | |
download | rails-c437a98acaf759d53a85151947709f5efe499a27.tar.gz rails-c437a98acaf759d53a85151947709f5efe499a27.tar.bz2 rails-c437a98acaf759d53a85151947709f5efe499a27.zip |
Merge pull request #13188 from imanel/skip_deep_munge
Add configuration option to optionally disable deep_munge
Conflicts:
actionpack/CHANGELOG.md
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/railtie.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/request/utils.rb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/railtie.rb b/actionpack/lib/action_dispatch/railtie.rb index 2dfaab3587..ddeea24bb3 100644 --- a/actionpack/lib/action_dispatch/railtie.rb +++ b/actionpack/lib/action_dispatch/railtie.rb @@ -16,6 +16,7 @@ module ActionDispatch config.action_dispatch.signed_cookie_salt = 'signed cookie' config.action_dispatch.encrypted_cookie_salt = 'encrypted cookie' config.action_dispatch.encrypted_signed_cookie_salt = 'signed encrypted cookie' + config.action_dispatch.perform_deep_munge = true config.action_dispatch.default_headers = { 'X-Frame-Options' => 'SAMEORIGIN', @@ -28,6 +29,7 @@ module ActionDispatch initializer "action_dispatch.configure" do |app| ActionDispatch::Http::URL.tld_length = app.config.action_dispatch.tld_length ActionDispatch::Request.ignore_accept_header = app.config.action_dispatch.ignore_accept_header + ActionDispatch::Request::Utils.perform_deep_munge = app.config.action_dispatch.perform_deep_munge ActionDispatch::Response.default_charset = app.config.action_dispatch.default_charset || app.config.encoding ActionDispatch::Response.default_headers = app.config.action_dispatch.default_headers diff --git a/actionpack/lib/action_dispatch/request/utils.rb b/actionpack/lib/action_dispatch/request/utils.rb index 8b43cdada8..a6dca9741c 100644 --- a/actionpack/lib/action_dispatch/request/utils.rb +++ b/actionpack/lib/action_dispatch/request/utils.rb @@ -1,9 +1,15 @@ module ActionDispatch class Request < Rack::Request class Utils # :nodoc: + + mattr_accessor :perform_deep_munge + self.perform_deep_munge = true + class << self # Remove nils from the params hash def deep_munge(hash) + return hash unless perform_deep_munge + hash.each do |k, v| case v when Array |