mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
|
# Or badly formatted multipart requests
|
||||||
begin
|
begin
|
||||||
request.POST
|
request.POST
|
||||||
rescue EOFError
|
rescue ActionController::BadRequest => error
|
||||||
return [
|
if error.cause.is_a?(EOFError)
|
||||||
400,
|
return [
|
||||||
{ "Cache-Control" => "private, max-age=0, must-revalidate" },
|
400,
|
||||||
["Invalid request"]
|
{ "Cache-Control" => "private, max-age=0, must-revalidate" },
|
||||||
]
|
["Invalid request"]
|
||||||
|
]
|
||||||
|
else
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ApplicationController.rescue_with_handler(exception, object: fake_controller)
|
if ApplicationController.rescue_with_handler(exception, object: fake_controller)
|
||||||
|
Loading…
Reference in New Issue
Block a user