mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Handle more cases where HTTP status is not correct
HTTP status was not correct with send_file which uses streaming
This commit is contained in:
@@ -39,6 +39,7 @@ module Hijack
|
||||
instance = controller_class.new
|
||||
response = ActionDispatch::Response.new
|
||||
instance.response = response
|
||||
|
||||
instance.request = request_copy
|
||||
instance.params = params_copy
|
||||
|
||||
@@ -48,7 +49,7 @@ module Hijack
|
||||
Rails.logger.warn("Failed to process hijacked response correctly #{e}")
|
||||
end
|
||||
|
||||
unless instance.response_body
|
||||
unless instance.response_body || response.committed?
|
||||
instance.status = 500
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user