-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Inconsistent treatment of (terminal?) backslashes in Content-Disposition names (all header options?) #3032
Comments
This is an inconsistency in how browsers handle escaping quoted values. For some reason, |
Note that the current HTTP spec does not mention this special case. https://httpwg.org/specs/rfc9110.html#quoted.strings Searching back through obsoleted RFCs, I didn't find any mention of the special case. In fact, it says that our current behavior is correct:
|
Sure, I don't disagree that per the letter of the spec the behaviour is correct (kinda, werkzeug does discard the entire parameter value), and that the entire thing is a minefield (I originally had a link to curl/curl#7789 in there but apparently removed it during one of the edition passes I made). However,
|
Hit the issue because a form in a test case started returning a name
None
, which displeases python when used as a kwarg. That test form uses multipart/form-data and one of the input names ends with a\
.Content-Disposition: form-data; name="test\"
when the field name ends with a\
I was able to pinpoint 3.0.4 for the change so I assume it's related to #2904 (#2939) though I did not try reverting that.
werkzeug <= 3.0.3
werkzeug >= 3.0.4
Full test case
The text was updated successfully, but these errors were encountered: