You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
Need to consider the noBody situation for HEAD method #401
@bnoordhuis There is no http request body for the http request with HEAD method. And I found that the parser can't be finished normally (on_message_complete callbacks is triggered) in this situation.
This change matches a HEAD request (which had Upgrade headers or for which the user returned 2 from the on_headers_complete callback). A HEAD response may have a Content-Length but does not include the body. A HEAD request does not have the same rule. It really should not have a body, but if it has a non-zero Content-Length, the body must be present (and should be ignored by the server).
A payload within a HEAD request message has no defined semantics;
sending a payload body on a HEAD request might cause some existing
implementations to reject the request.
Activity
bnoordhuis commentedon Dec 18, 2017
Can you go in more detail? The diff doesn't look Obviously Correct to me.
tianchao-haohan commentedon Aug 14, 2018
@bnoordhuis There is no http request body for the http request with HEAD method. And I found that the parser can't be finished normally (on_message_complete callbacks is triggered) in this situation.
ploxiln commentedon Aug 14, 2018
This change matches a HEAD request (which had Upgrade headers or for which the user returned 2 from the
on_headers_completecallback). A HEAD response may have aContent-Lengthbut does not include the body. A HEAD request does not have the same rule. It really should not have a body, but if it has a non-zero Content-Length, the body must be present (and should be ignored by the server).https://tools.ietf.org/html/rfc7231#section-4.3.2