aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2017-04-26 20:54:12 -0700
committerGitHub <noreply@github.com>2017-04-26 20:54:12 -0700
commitc5663c428218fc6e1ed78fa6bbf85a88991e9bde (patch)
tree82f2ee98d000c3c0451d505521e5fde9df6a163d /actionpack
parent3090017c6310b2eca5de3770e4a84d0cfa0d781e (diff)
parente06f68fdb2132623d27a26ae58213b09ecb308ee (diff)
downloadrails-c5663c428218fc6e1ed78fa6bbf85a88991e9bde.tar.gz
rails-c5663c428218fc6e1ed78fa6bbf85a88991e9bde.tar.bz2
rails-c5663c428218fc6e1ed78fa6bbf85a88991e9bde.zip
Merge pull request #28897 from rafaelfranca/fix-name-error-error-page
Do not try to encoding the parameters when the controller is not defined
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb
index 79a2ef965b..7c585dbe68 100644
--- a/actionpack/lib/action_dispatch/http/parameters.rb
+++ b/actionpack/lib/action_dispatch/http/parameters.rb
@@ -85,7 +85,7 @@ module ActionDispatch
def set_binary_encoding(params)
action = params[:action]
- if controller_class.binary_params_for?(action)
+ if binary_params_for?(action)
ActionDispatch::Request::Utils.each_param_value(params) do |param|
param.force_encoding ::Encoding::ASCII_8BIT
end
@@ -93,6 +93,12 @@ module ActionDispatch
params
end
+ def binary_params_for?(action)
+ controller_class.binary_params_for?(action)
+ rescue NameError
+ false
+ end
+
def parse_formatted_parameters(parsers)
return yield if content_length.zero? || content_mime_type.nil?