Skip to content

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

Open
ttys3 wants to merge 1 commit intosubhra74:feature/latest-devfrom
ttys3:fixup-content-disposition-attachment-filename
Open

fix GetContentDispositionFileName can not correctly handle RFC 6266 specific filename* param#1013
ttys3 wants to merge 1 commit intosubhra74:feature/latest-devfrom
ttys3:fixup-content-disposition-attachment-filename

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.

2 participants