mirror of https://github.com/rails/rails
Fixes ActiveStorage proxy downloads of files over 5mb in S3-like storage services
This commit is contained in:
parent
06610c49fb
commit
e4eab9892f
|
@ -1,3 +1,15 @@
|
|||
* Fixes proxy downloads of files over 5mb
|
||||
|
||||
Previously, trying to view and/or download files larger than 5mb stored in
|
||||
services like S3 via proxy mode could return corrupted files at around
|
||||
5.2mb or cause random halts in the download. Now,
|
||||
`ActiveStorage::Blobs::ProxyController` correctly handles streaming these
|
||||
larger files from the service to the client without any issues.
|
||||
|
||||
Fixes #44679
|
||||
|
||||
*Felipe Raul*
|
||||
|
||||
* Saving attachment(s) to a record returns the blob/blobs object
|
||||
|
||||
Previously, saving attachments did not return the blob/blobs that
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
require "securerandom"
|
||||
|
||||
module ActiveStorage::Streaming
|
||||
extend ActiveSupport::Concern
|
||||
DEFAULT_BLOB_STREAMING_DISPOSITION = "inline"
|
||||
|
||||
include ActionController::DataStreaming
|
||||
|
|
|
@ -85,6 +85,14 @@ class ActiveStorage::Blobs::ProxyControllerTest < ActionDispatch::IntegrationTes
|
|||
)
|
||||
end
|
||||
end
|
||||
|
||||
test "uses a Live::Response" do
|
||||
# This tests for a regression of #45102. If the controller doesn't respond
|
||||
# with a ActionController::Live::Response, it will serve corrupted files
|
||||
# over 5mb when using S3 services.
|
||||
request = ActionController::TestRequest.create({})
|
||||
assert_instance_of ActionController::Live::Response, ActiveStorage::Blobs::ProxyController.make_response!(request)
|
||||
end
|
||||
end
|
||||
|
||||
class ActiveStorage::Blobs::ExpiringProxyControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
Loading…
Reference in New Issue