-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Read GET/HEAD body if it exists #171
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
Conversation
I would be happy to modify this to completely discard the body as well if that is the preferred behavior. That might be more in line with the spec. Just let me know. |
What is the use case for this feature? |
Unfortunately, there are quite a few real world GET requests that have a On Wed, Oct 5, 2016, 3:23 AM Aliaksandr Valialkin [email protected]
|
You can send a body with GET, but it's never useful to do so. This is part of the layered design of HTTP/1.1 will become clear again once the spec is partitioned, future changes may discard this option |
I agree it is not useful to send a body. The intent of this PR is not to On Wed, Oct 5, 2016, 4:42 AM Gerasimos Maropoulos [email protected]
|
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification states: "A server SHOULD read and forward a message-body on any request; if the request method does not include defined semantics for an entity-body, then the message-body SHOULD be ignored when handling the request. I suspect this code is at fault." This change reads the body on such request and continues the previous behavior of returning a "Content-Length" of 0 to the application. Closes valyala#159.
9e4b4b5
to
13d5893
Compare
An alternative to this PR would be to return a 4xx error on GET requests with a body. |
We are also having this same problem. We are losing connections due to this bug. |
'What is the use case for this feature?
Furthermore, it violates the robustness principle to not accept such requests. |
Almost all our requests to this service come from JS on browsers, and we are missing quite a few due to this bug. Please accept a patch. |
Please accept this patch. |
1 similar comment
Please accept this patch. |
I also need this feature! |
+1 |
I merged the pull request into my branch which contains other important fixes such as erikdubbelboer@28a6163 as well. |
Thanks, @erikdubbelboer! I've switched to using your fork. |
thanks for the patch . |
Was fixed in cf6f6e7 |
Thanks! I'll close this. |
Previously, GET/HEAD bodies were not read. The HTTP 1.1 specification
states:
This change reads the body on such request and continues the previous
behavior of returning a "Content-Length" of 0 to the application.
Closes #159.