Encode Content-Disposition filenames
All threads resolved!
All threads resolved!
Compare changes
Files
13@@ -3,16 +3,19 @@
@@ -25,6 +28,18 @@ module SendFileUpload
Users downloading non-ASCII attachments would see garbled characters. When used with object storage, AWS S3 would return an InvalidArgument error: Header value cannot be represented using ISO-8859-1.
Per RFC 5987 and RFC 6266, Content-Disposition should be encoded
properly. This commit takes the Rails 6 implementation of
ActiveSuppport::Http::ContentDisposition
(https://github.com/rails/rails/pull/33829) and ports it here.
However, due to gitlab-workhorse#207 (closed),
the UTF-8 encoded Content-Disposition
doesn't actually get sent to the user.
This MR at least fixes AWS S3 access.