-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add optional flag for quoting fields #916
Conversation
RFC stanard requires all fields to be US-ASCII. Additional `quote` may provide extra security (RFC-1806 p. 2.3), but does not allow for interoperability with API that requires ASCII characters outside `quote` set e.g. emails[] becomes emails%5B%5D fixes aio-libs#903
Looks good. |
Actually, the problem is a bit bigger. Aiohttp doesn't implement specification properly see http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.19.5.1 Field can be a |
@lukasz-madon: You'll want to find the latest MIME RFCs to point to instead. Not only is RFC 2616 obsolete, but I don't think it ever applied to multipart payloads to begin with. https://tools.ietf.org/html/rfc7578#section-4.2, https://tools.ietf.org/html/rfc2183, and https://tools.ietf.org/html/rfc2231 might be good starting points? I am not a MIME expert... |
@jchampio not a MIME expert, but looking at RFC and other implementations |
@lukasz-madon This case is invalid according test suite we used to implement Content-Disposition parser. Though major part of browsers allows that, the spec says the other. |
@kxepal thoughts? |
Hm...I was wrong in previous message about it's wrong - I miss the quotes in test. @fafhrd91 need a bit time to make sure that's correct, but so far LGFM. |
@kxepal merge whenever ready |
@fafhrd91 ok |
@kxepal i need you to make a decision |
@fafhrd91 Sorry, I forgot about. |
Thanks! |
The reason for the `aiohttp2` file existing is now redundant (aio-libs/aiohttp#916 got merged), so migrated to use regular aiohttp `MultipartWriter`.
What do these changes do?
Add a flag for quoting fields.
RFC standard requires all fields to be US-ASCII. Additional
quote
may provide extra security (RFC-1806 p. 2.3), but does not allow
for interoperability with API that requires ASCII characters outside
quote
set e.g. emails[] becomes emails%5B%5DAre there changes in behavior for the user?
There will be no change for current users (the parameter defaults to True). Users that want to skip quoting can pass the flag to constructor.
Related issue number
fixes #903
Checklist