diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2018-09-23 19:43:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-23 19:43:06 +0200 |
commit | ed56a031041a868eeeb439d8b79d04565be1286f (patch) | |
tree | ce6a75a8a34c92f2291a2188845ce2084e069b89 /activestorage/test/models/blob_test.rb | |
parent | 22dc2b3db894cb709c132456d787166839455a8e (diff) | |
parent | 890485cfce4c361c03a41ec23b0ba187007818cc (diff) | |
download | rails-ed56a031041a868eeeb439d8b79d04565be1286f.tar.gz rails-ed56a031041a868eeeb439d8b79d04565be1286f.tar.bz2 rails-ed56a031041a868eeeb439d8b79d04565be1286f.zip |
Merge pull request #33829 from mtsmfm/encode-filename
Encode Content-Disposition filenames on send_data and send_file
Diffstat (limited to 'activestorage/test/models/blob_test.rb')
-rw-r--r-- | activestorage/test/models/blob_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/test/models/blob_test.rb b/activestorage/test/models/blob_test.rb index 88c106a08b..1a6a89de56 100644 --- a/activestorage/test/models/blob_test.rb +++ b/activestorage/test/models/blob_test.rb @@ -185,7 +185,7 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase private def expected_url_for(blob, disposition: :inline, filename: nil) filename ||= blob.filename - query_string = { content_type: blob.content_type, disposition: "#{disposition}; #{filename.parameters}" }.to_param + query_string = { content_type: blob.content_type, disposition: ActionDispatch::Http::ContentDisposition.format(disposition: disposition, filename: filename.sanitized) }.to_param "https://example.com/rails/active_storage/disk/#{ActiveStorage.verifier.generate(blob.key, expires_in: 5.minutes, purpose: :blob_key)}/#{filename}?#{query_string}" end end |