diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2015-10-19 13:11:19 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2015-10-19 13:11:19 -0200 |
commit | b456e76f58a05a127bb670e63a9446e457f1f59d (patch) | |
tree | 68abd2546ae7b8289007def1f32719916b7a3ca1 /actionpack/lib/action_dispatch | |
parent | dd2c94aea6de51b58f75f192e5de16e791b9d2d9 (diff) | |
parent | 3f81b3753ffdca8617422e518e1fddd581f5a712 (diff) | |
download | rails-b456e76f58a05a127bb670e63a9446e457f1f59d.tar.gz rails-b456e76f58a05a127bb670e63a9446e457f1f59d.tar.bz2 rails-b456e76f58a05a127bb670e63a9446e457f1f59d.zip |
Merge pull request #21999 from agis-/param-encoding-errors
Show helpful messages on invalid param. encodings
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index bf20a33d36..c6ab4dbc9a 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -65,7 +65,7 @@ module ActionDispatch path_parameters.each do |key, value| next unless value.respond_to?(:valid_encoding?) unless value.valid_encoding? - raise ActionController::BadRequest, "Invalid parameter: #{key} => #{value}" + raise ActionController::BadRequest, "Invalid parameter encoding: #{key} => #{value.inspect}" end end end @@ -341,7 +341,7 @@ module ActionDispatch set_header k, Request::Utils.normalize_encode_params(super || {}) end rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e - raise ActionController::BadRequest.new(:query, e) + raise ActionController::BadRequest.new("Invalid query parameters: #{e.message}", e) end alias :query_parameters :GET @@ -357,7 +357,7 @@ module ActionDispatch self.request_parameters = Request::Utils.normalize_encode_params(super || {}) raise rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e - raise ActionController::BadRequest.new(:request, e) + raise ActionController::BadRequest.new("Invalid request parameters: #{e.message}", e) end alias :request_parameters :POST |