diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-09 00:23:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-09 00:23:11 +0200 |
commit | 839834ed6fc428f777360e7fda5dfb42676e839a (patch) | |
tree | efe28698e7886dde03681b03dfdc1db9c7d07475 /lib/active_storage/service/disk_service.rb | |
parent | 255b1a149c8be93ede25404c53933bde3acc2dc2 (diff) | |
parent | 03120ecb50016fc210945d0824c11d9308b28372 (diff) | |
download | rails-839834ed6fc428f777360e7fda5dfb42676e839a.tar.gz rails-839834ed6fc428f777360e7fda5dfb42676e839a.tar.bz2 rails-839834ed6fc428f777360e7fda5dfb42676e839a.zip |
Merge pull request #22 from jeremy/disk-filename-url
Disk storage: ensure URLs end with the blob filename
Diffstat (limited to 'lib/active_storage/service/disk_service.rb')
-rw-r--r-- | lib/active_storage/service/disk_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/active_storage/service/disk_service.rb b/lib/active_storage/service/disk_service.rb index 6164caf86c..5576b3b125 100644 --- a/lib/active_storage/service/disk_service.rb +++ b/lib/active_storage/service/disk_service.rb @@ -43,9 +43,9 @@ class ActiveStorage::Service::DiskService < ActiveStorage::Service verified_key_with_expiration = ActiveStorage::VerifiedKeyWithExpiration.encode(key, expires_in: expires_in) if defined?(Rails) && defined?(Rails.application) - Rails.application.routes.url_helpers.rails_disk_blob_path(verified_key_with_expiration, disposition: disposition) + Rails.application.routes.url_helpers.rails_disk_blob_path(verified_key_with_expiration, disposition: disposition, filename: filename) else - "/rails/blobs/#{verified_key_with_expiration}?disposition=#{disposition}" + "/rails/blobs/#{verified_key_with_expiration}/#{filename}?disposition=#{disposition}" end end |