Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GetContentDispositionFileName can not correctly handle RFC 6266 specific filename* param #1013

Open
wants to merge 1 commit into
base: feature/latest-dev
Choose a base branch
from

Conversation

ttys3
Copy link

@ttys3 ttys3 commented Mar 21, 2023

resolve #1012

fix: fix GetContentDispositionFileName can not correctly handle RFC 6266 specific filename* param

Refs: https://www.rfc-editor.org/rfc/rfc6266#section-4.3

example content-disposition header from Sharepoint storage:

content-disposition: attachment;filename*=utf-8''foo%2Erar;filename="foo.rar"

https://httpwg.org/specs/rfc6266.html#header.field.definition

https://httpwg.org/specs/rfc6266.html#disposition.parameter.filename

https://www.iana.org/assignments/cont-disp/cont-disp.xhtml

according https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives

The parameters filename and filename* differ only in that filename* uses the encoding defined in RFC 5987.
When both filename and filename* are present in a single header field value, filename* is preferred over filename when both are understood.

@ahmedmoselhi
Copy link

Thnx for this one I confirm it now works like expected

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.

None yet

2 participants