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

Percent encoding of content-disposition parameter values #295

Closed
rollandjb opened this issue May 11, 2018 · 1 comment
Closed

Percent encoding of content-disposition parameter values #295

rollandjb opened this issue May 11, 2018 · 1 comment

Comments

@rollandjb
Copy link

There seems to be a problem with how reqwest encodes values of Content-Disposition parameters.

RFC 6266 and RFC 8187 defines the characters that can be included without percent encoding in an encoded value of a Content-Disposition parameter as

 attr-char  = ALPHA / DIGIT
              / "!" / "#" / "$" / "&" / "+" / "-" / "."
              / "^" / "_" / "`" / "|" / "~"

which is to say

 a-zA-Z0-9!#$&+-.^_`|~

Reqwest uses PATH_SEGMENT_ENCODE_SET from the url crate to encode parameter values, which in addition allows the following characters

 '(),=@[\]

This causes problems when files having any of these characters in their names are uploaded to servers that rely on the RFC

@yageek
Copy link
Contributor

yageek commented Oct 5, 2018

Sorry for polluting the history with bad commits :( I had some issues with my network and keyboard...

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

No branches or pull requests

2 participants