diff options
Diffstat (limited to 'activestorage/app')
-rw-r--r-- | activestorage/app/controllers/active_storage/disk_controller.rb | 4 | ||||
-rw-r--r-- | activestorage/app/models/active_storage/blob.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activestorage/app/controllers/active_storage/disk_controller.rb b/activestorage/app/controllers/active_storage/disk_controller.rb index b10d4e2cac..41e6d61bff 100644 --- a/activestorage/app/controllers/active_storage/disk_controller.rb +++ b/activestorage/app/controllers/active_storage/disk_controller.rb @@ -8,7 +8,7 @@ class ActiveStorage::DiskController < ActionController::Base def show if key = decode_verified_key send_data disk_service.download(key), - filename: params[:filename], disposition: disposition_param, content_type: params[:content_type] + disposition: disposition_param, content_type: params[:content_type] else head :not_found end @@ -39,7 +39,7 @@ class ActiveStorage::DiskController < ActionController::Base end def disposition_param - params[:disposition].presence_in(%w( inline attachment )) || "inline" + params[:disposition].presence || "inline" end diff --git a/activestorage/app/models/active_storage/blob.rb b/activestorage/app/models/active_storage/blob.rb index 9f2ed1e5ac..2e627ef118 100644 --- a/activestorage/app/models/active_storage/blob.rb +++ b/activestorage/app/models/active_storage/blob.rb @@ -127,7 +127,7 @@ class ActiveStorage::Blob < ActiveRecord::Base # Hiding the +service_url+ behind a redirect also gives you the power to change services without updating all URLs. And # it allows permanent URLs that redirect to the +service_url+ to be cached in the view. def service_url(expires_in: 5.minutes, disposition: :inline) - service.url key, expires_in: expires_in, disposition: disposition, filename: filename, content_type: content_type + service.url key, expires_in: expires_in, disposition: "#{disposition}; filename=\"#{filename}\"", filename: filename, content_type: content_type end # Returns a URL that can be used to directly upload a file for this blob on the service. This URL is intended to be |