diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-15 16:03:46 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-15 16:03:46 -0300 |
commit | ba769cc4836cd909fd6dd659220790d9b98e4072 (patch) | |
tree | bcd8df142b6f089e91ae5a17c16b71a22869a73e /actionpack | |
parent | 448928f6396af9ac70dfe8a197f60166aadf7a43 (diff) | |
parent | 7a7ccc31e7d883c8e5c5fed91c1cea2fbe32f6c9 (diff) | |
download | rails-ba769cc4836cd909fd6dd659220790d9b98e4072.tar.gz rails-ba769cc4836cd909fd6dd659220790d9b98e4072.tar.bz2 rails-ba769cc4836cd909fd6dd659220790d9b98e4072.zip |
Merge pull request #17255 from printercu/cors_exception_wrapper
ActionController::InvalidCrossOriginRequest fails with 422 instead of 500
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index b98b553c38..a6285848b5 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -6,16 +6,17 @@ module ActionDispatch cattr_accessor :rescue_responses @@rescue_responses = Hash.new(:internal_server_error) @@rescue_responses.merge!( - 'ActionController::RoutingError' => :not_found, - 'AbstractController::ActionNotFound' => :not_found, - 'ActionController::MethodNotAllowed' => :method_not_allowed, - 'ActionController::UnknownHttpMethod' => :method_not_allowed, - 'ActionController::NotImplemented' => :not_implemented, - 'ActionController::UnknownFormat' => :not_acceptable, - 'ActionController::InvalidAuthenticityToken' => :unprocessable_entity, - 'ActionDispatch::ParamsParser::ParseError' => :bad_request, - 'ActionController::BadRequest' => :bad_request, - 'ActionController::ParameterMissing' => :bad_request + 'ActionController::RoutingError' => :not_found, + 'AbstractController::ActionNotFound' => :not_found, + 'ActionController::MethodNotAllowed' => :method_not_allowed, + 'ActionController::UnknownHttpMethod' => :method_not_allowed, + 'ActionController::NotImplemented' => :not_implemented, + 'ActionController::UnknownFormat' => :not_acceptable, + 'ActionController::InvalidAuthenticityToken' => :unprocessable_entity, + 'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity, + 'ActionDispatch::ParamsParser::ParseError' => :bad_request, + 'ActionController::BadRequest' => :bad_request, + 'ActionController::ParameterMissing' => :bad_request ) cattr_accessor :rescue_templates |