Skip to content
Snippets Groups Projects

Encode Content-Disposition filenames

Merged Stan Hu requested to merge sh-encode-content-disposition into master
All threads resolved!

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.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47673

Edited by Stan Hu

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sean McGivern
  • Sean McGivern
  • @stanhu that's amazing, thanks! I didn't mean for you to take this, just to double-check my assumption.

  • assigned to @stanhu

  • Stan Hu added 1 commit

    added 1 commit

    • e6850f73 - Add Rails 6 deprecation error message

    Compare with previous version

  • Stan Hu resolved all discussions

    resolved all discussions

  • assigned to @smcgivern

  • Sean McGivern approved this merge request

    approved this merge request

  • Sean McGivern enabled an automatic merge when the pipeline for e6850f73 succeeds

    enabled an automatic merge when the pipeline for e6850f73 succeeds

  • merged

  • Sean McGivern mentioned in commit f04910f2

    mentioned in commit f04910f2

  • mentioned in merge request gitlab-workhorse!360 (merged)

  • Stan Hu mentioned in issue #57660 (closed)

    mentioned in issue #57660 (closed)

  • Stan Hu mentioned in commit 248ec6cd

    mentioned in commit 248ec6cd

  • Stan Hu mentioned in merge request !25214 (merged)

    mentioned in merge request !25214 (merged)

  • Stan Hu mentioned in commit 134420f2

    mentioned in commit 134420f2

  • Please register or sign in to reply
    Loading