-
-
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
Some servers don't understand quoted boundaries in multipart documents #2544
Comments
Make sense. Pull Request is needed |
@FichteFoll would you propose requested change? |
I was in fact already working on it, but had issues with the test environment and decided to hold off until a decision was made. Is there some part in the code that handles parameter quotation as outlined in the above ABNF already? This seems to be used in a couple places. Edit: And if no, what would be a good place to add it? For the record, the |
Perhaps @kxepal is the best person for answering on the question. |
@FichteFoll |
Perhaps the server is not 100% compliant with HTTP spec. |
I recall similar problem with cookies. |
IIRC for cookies we also do quote all the time and still happy. |
It does. More precisely cookies are started to be quoted in Python 3.4 or 3.5 -- I don't remember. |
I agree that the server is behaving badly here, but it should be in the interest of the client to reach maximum compatibility with existing server implementations as long as it doesn't require too much work or is out-of-scope. I already reported this problem to their support and asked for the exact version of nginx they are using, but haven't received a reply since then. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
After a prolonged debugging session I discovered that the usage of quotes in the boundary of a multipart document caused my request to be rejected by the server since it didn't support this.
Preventing the quotation marks from being added in the code makes this work.
The server in question is using nginx, but I don't know which version yet (asked their support).
Specification
https://tools.ietf.org/html/rfc7231#section-3.1.1.5
https://tools.ietf.org/html/rfc7231#appendix-D
https://tools.ietf.org/html/rfc7230#section-3.2.6
Expected behaviour
Specify the multipart boundary without quotes, unless they are required.
Actual behaviour
Multipart boundary is always quoted.
Steps to reproduce
Since I don't know which nginx version is affected, the only reliable way to reproduce right now is by filing a request at share-online's upload API.
A sample script is provided below (fill in your data):
With this script, the upload will fail with
*** EXCEPTION session creation/reuse failed - 11-21-2017, 3:13 pm ***
.Removing the quotes at
aiohttp/aiohttp/multipart.py
Line 640 in 439c732
Your environment
Arch Linux, Python 3.6, aiohttp 2.3.3 (client)
The text was updated successfully, but these errors were encountered: