Skip to content

fix: emit RFC 5987 filename* in Attachment/Inline#3058

Open
sonnemusk wants to merge 1 commit into
labstack:masterfrom
sonnemusk:fix/content-disposition-filename-star
Open

fix: emit RFC 5987 filename* in Attachment/Inline#3058
sonnemusk wants to merge 1 commit into
labstack:masterfrom
sonnemusk:fix/content-disposition-filename-star

Conversation

@sonnemusk

Copy link
Copy Markdown
Contributor

Summary

Attachment / Inline only set a quoted filename= parameter. Non-ASCII names (e.g. 报告.pdf) are often mangled by browsers.

Change

  • Keep filename= for legacy clients.
  • Also emit filename*=UTF-8''… encoded with url.PathEscape (RFC 5987 / 6266).
  • Extend unit tests including a non-ASCII name.

Test plan

  • go test . -run 'TestContextAttachment|TestContextInline'

Content-Disposition only set a quoted filename=, which breaks non-ASCII
download names in many browsers. Keep filename= for legacy clients and add
filename*=UTF-8'' with url.PathEscape.
@sonnemusk
sonnemusk force-pushed the fix/content-disposition-filename-star branch from 5326dae to 935e1a1 Compare July 22, 2026 07:56
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (dcb05f0) to head (935e1a1).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3058   +/-   ##
=======================================
  Coverage   93.34%   93.35%           
=======================================
  Files          43       43           
  Lines        4735     4740    +5     
=======================================
+ Hits         4420     4425    +5     
  Misses        192      192           
  Partials      123      123           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant