aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-19 15:32:16 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-19 15:36:05 -0300
commitd59a24d543b4fd34d453e8209caae5fef315ea78 (patch)
tree109b429dd60534634379583f3cf8d391c9f95fb5 /actionpack/lib
parent4d1d81d33804449b19f34643b4ed396a5da02edc (diff)
downloadrails-d59a24d543b4fd34d453e8209caae5fef315ea78.tar.gz
rails-d59a24d543b4fd34d453e8209caae5fef315ea78.tar.bz2
rails-d59a24d543b4fd34d453e8209caae5fef315ea78.zip
Protect against error when parsing parameters with Bad Request
Related with #11795.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 8c035c3c6c..f35289253b 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -292,7 +292,7 @@ module ActionDispatch
# Override Rack's GET method to support indifferent access
def GET
@env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
- rescue TypeError => e
+ rescue TypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:query, e)
end
alias :query_parameters :GET
@@ -300,7 +300,7 @@ module ActionDispatch
# Override Rack's POST method to support indifferent access
def POST
@env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
- rescue TypeError => e
+ rescue TypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:request, e)
end
alias :request_parameters :POST