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
Nevertheless I believe that in this specific case (A Content-Length header with a value of 0 for a request that isn't expecting a payload) the error could be silently ignored (do not log the body not consumed message)
Hmm, I am not sure I agree that it is Sanic's responsibility for ignoring that.
A user agent SHOULD NOT send a Content-Length header field when the request message does not contain content and the method semantics do not anticipate such data.
A client SHOULD NOT generate content in a GET request unless it is made directly to an origin server that has previously indicated, in or out of band, that such a request has a purpose and will be adequately supported.
The default http check from HAProxy v2.4.22 performs a request that looks like this :
When presented with such a request sanic logs an error in the form of :
[sanic.error] <Request: GET /health> body not consumed.
The issue here is with the
content-length
header being sent for aGET
request that should not contain a payload.Even though the value is
0
Sanic seems to believe the request has a payload.The RFCs are not clear as to whether it is actually allowed or forbidden to send this header for
GET
requests :Nevertheless I believe that in this specific case (A
Content-Length
header with a value of0
for a request that isn't expecting a payload) the error could be silently ignored (do not log thebody not consumed
message)The haproxy issue has since been adressed (haproxy/haproxy#2026)
Originally posted in #2685 (comment)
The text was updated successfully, but these errors were encountered: