FIX: Correctly encode non-ASCII filenames in HTTP header

Backport of fix from Rails 6: 890485cfce
This commit is contained in:
Gerhard Schlager
2019-08-07 17:00:43 +02:00
parent e90aac11cb
commit 24877a7b8c
4 changed files with 112 additions and 6 deletions

View File

@ -413,7 +413,7 @@ describe FileStore::S3Store do
s3_bucket.expects(:object).with("original/1X/#{upload.sha1}.png").returns(s3_object)
opts = {
expires_in: S3Helper::DOWNLOAD_URL_EXPIRES_AFTER_SECONDS,
response_content_disposition: "attachment; filename=\"#{upload.original_filename}\""
response_content_disposition: %Q|attachment; filename="#{upload.original_filename}"; filename*=UTF-8''#{upload.original_filename}|
}
s3_object.expects(:presigned_url).with(:get, opts)