From 890485cfce4c361c03a41ec23b0ba187007818cc Mon Sep 17 00:00:00 2001 From: Fumiaki MATSUSHIMA Date: Sun, 9 Sep 2018 16:35:48 +0900 Subject: Encode Content-Disposition filenames on send_data and send_file --- activestorage/test/models/blob_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activestorage/test/models/blob_test.rb') 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 -- cgit v1.2.3