aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_storage/service
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_storage/service')
-rw-r--r--lib/active_storage/service/disk_service.rb2
-rw-r--r--lib/active_storage/service/s3_service.rb8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/active_storage/service/disk_service.rb b/lib/active_storage/service/disk_service.rb
index 7e64e1e909..a2a27528c1 100644
--- a/lib/active_storage/service/disk_service.rb
+++ b/lib/active_storage/service/disk_service.rb
@@ -20,7 +20,7 @@ class ActiveStorage::Service::DiskService < ActiveStorage::Service
def download(key)
if block_given?
instrument :streaming_download, key do
- File.open(path_for(key), 'rb') do |file|
+ File.open(path_for(key), "rb") do |file|
while data = file.read(64.kilobytes)
yield data
end
diff --git a/lib/active_storage/service/s3_service.rb b/lib/active_storage/service/s3_service.rb
index c3b6688bb9..e75ac36c7d 100644
--- a/lib/active_storage/service/s3_service.rb
+++ b/lib/active_storage/service/s3_service.rb
@@ -49,9 +49,9 @@ class ActiveStorage::Service::S3Service < ActiveStorage::Service
instrument :url, key do |payload|
generated_url = object_for(key).presigned_url :get, expires_in: expires_in,
response_content_disposition: "#{disposition}; filename=\"#{filename}\""
-
+
payload[:url] = generated_url
-
+
generated_url
end
end
@@ -60,9 +60,9 @@ class ActiveStorage::Service::S3Service < ActiveStorage::Service
instrument :url, key do |payload|
generated_url = object_for(key).presigned_url :put, expires_in: expires_in,
content_type: content_type, content_length: content_length
-
+
payload[:url] = generated_url
-
+
generated_url
end
end