-
-
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
Enable to remove "Content-Length: 0" for GET Request #2167
Comments
https://stackoverflow.com/questions/978061/http-get-with-request-body?answertab=active#tab-top Content length mean presensce of a body, but with zero length. I prefer to close as "not a bug". No one http-client will send such requests. And sending body with GET-request difinitely signify a bug in client. RFC on HTTP is not strict enough, so current implementation of this case still leaves aiohttp RFC-compliant. Handling such reqests will not bring any benefits, just code bloat. Why you want such functionality ? Also please update aiohttp and re-test. |
Because I found send GET request with "Content-Length: 0" header to some kind of servers will cause a bad request error.
I have tried aiohttp-2.2.5, still a "Content-Length: 0" in the request's header. |
Since it's not an security error, does not fix any real problem, does not add new functionality, I'm -3 for this issue. |
is it possible to disable |
Unfortunately no. |
I think we should support this use case |
Agree.
I prefer second bullet but it requires much more work. |
Sorry, I did not catch original problem :(. As I think, Aiohttp has a bug. GET/HEAD/TRACE-requests hould not send content-length in any case. |
Please review #2191 |
I appreciate that you value this issue. 👍 I apologize for my poor English. |
Fixed by #2167 |
"Connection:Keep-Alive" and "Content-Length:0" should be together. |
Why? |
Long story short
When I send GET request to some http server with the "Content-Length: 0" header, will cause a aiohttp.ServerDisconnectedError. If I remove this header, everything goes well.
I don't know why these server hate empty content-length header so much.
Expected behaviour
Some args to remove Content-Length if it is 0 and method is GET.
Steps to reproduce
You can test by using the comands below.
Your environment
aiohttp: 2.0.7
OS & Python:
The text was updated successfully, but these errors were encountered: