-
-
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
aiohttp.http_exceptions.BadStatusLine caused by extra CRLF after POST data #1792
Comments
Could you test it with c-extension enabled. |
Hi, @fafhrd91 . Thanks for the suggestion, it only affects pure-python parser. Btw, c-based parser does not build on old pip 6.0.8 (default on my Fedora).
With pip-9.0.1, it will install wheel package of |
try to install aiohttp from 2.0 branch |
Same result..
But we digress. The topic of this issue is http parsing. I'm grateful that you gave me a workaround which we can implement. We should have been using c-based aiohttp all along. Upgrading pip before installing |
you need to install cython |
@fafhrd91 version 2.0.6-1 from PyPI installs fine (even on pip 6.x and without cython). Thanks! |
@zarnovican so do you have same problem with c-based parser? |
@fafhrd91 No. The problem does not exhibit there. AFAIK py-parser and c-parser are still not equal with regard to CRLF handling. Something like this can re-surface again. Closing the ticket anyway. Feel free to reopen.. |
while implementing parser in rust, I noticed all parsers actually remove CRLF at the begging of stream. |
fixed in master |
Long story short
Some http clients may send extra CRLF after POST data. These extra two bytes are not accounted in Content-Length. It will cause..
We have noticed this problem after upgrade to
aiohttp
2.x withcheck_http
client (part of Nagios/Icinga).Bisect shows that this commit 51baae6 broke it. Seems like all 2.x are affected.
I'm inclined to believe that this is a client's problem. Which, I have reported nagios-plugins/nagios-plugins#266. However, this behavior was "broken" by a change in
aiohttp
, so I'm reporting it also here, for people to find it. Also, it may be a case thataiohttp
is too strict in parsing and there may be other clients behaving likecheck_http
.Feel free to close it, if you believe it is not
aiohttp
's problem.Expected behaviour
See linked ticket.
Actual behaviour
See linked ticket.
Steps to reproduce
See linked ticket.
Your environment
There is no proxy/nat/firewall between them. It is reproducible on localhost.
The text was updated successfully, but these errors were encountered: