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

http: Fix filename parsing from content-disposition #430

Conversation

starrify
Copy link
Contributor

Fixes #429.

This not mostly ideal (RFC 6266 prefers filename* if present) yet may be considered good enough if we don't want to introdue UTF-8 decoding here.

Fixes axel-download-accelerator#429.

This not mostly ideal (RFC 6266 prefers `filename*` if present) yet may
be considered good enough if we don't want to introdue UTF-8 decoding
here.
@starrify
Copy link
Contributor Author

Sorry I forgot to mention that this patch does introduce a new type of mishandling on semicolons. With this patch, the below payload

content-disposition: attachment; filename="foo;bar"

would result in foo being the filename, not foo;bar. This is due to the lack of handling quoted strings here.

Despite this, I'd assume that this patch still beneficial overall, since it's considered less common that a web server indeed includes a semicolon as part of a filename than that an additional filename* parameter appears.

@ismaell ismaell merged commit 2dbcc73 into axel-download-accelerator:master Mar 11, 2024
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.

Parsing the content-disposition header with additional filename* parameter
2 participants