DEV: Fix failing spec after Rails upgrade to 7.0.5.1 (#22317)
Follow up to 4d3999de10
This commit is contained in:
parent
cec68b3e2c
commit
68bb53a196
|
@ -49,12 +49,16 @@ module Middleware
|
|||
# Or badly formatted multipart requests
|
||||
begin
|
||||
request.POST
|
||||
rescue EOFError
|
||||
return [
|
||||
400,
|
||||
{ "Cache-Control" => "private, max-age=0, must-revalidate" },
|
||||
["Invalid request"]
|
||||
]
|
||||
rescue ActionController::BadRequest => error
|
||||
if error.cause.is_a?(EOFError)
|
||||
return [
|
||||
400,
|
||||
{ "Cache-Control" => "private, max-age=0, must-revalidate" },
|
||||
["Invalid request"]
|
||||
]
|
||||
else
|
||||
raise
|
||||
end
|
||||
end
|
||||
|
||||
if ApplicationController.rescue_with_handler(exception, object: fake_controller)
|
||||
|
|
Loading…
Reference in New Issue