-
Notifications
You must be signed in to change notification settings - Fork 524
Reject requests that don't set Content-Length or Transfer-Encoding: chunked #1130
Comments
I was re-reading the spec and it says this:
https://tools.ietf.org/html/rfc7230#section-3.3 Which means there's no "hard rule" for what methods can or cannot contain a body. RFC 7231 actually helps here. For GET, it says
https://tools.ietf.org/html/rfc7231#section-4.3.1 There are similar statements for HEAD, DELETE and CONNECT. It explicitly forbids a message body in TRACE requests. OPTIONS is the least clear one - the spec mentions We already somewhat guard against messages that don't specify a content length by assuming 0. This means things could silently fail or behave strangely for some apps. Deciding on a set of methods and sending a 411 is more explicit. |
I'm thinking of making this change for POST and PUT only, leaving OPTIONS out (I'm not familiar with how clients use OPTIONS). |
This seems to be what IIS does btw. I know lighttpd requires |
Same for nginx. |
If we can't get this in soon, let's move it to 1.2.0. |
Requests containing a body (POST, PUT, CONNECT, PATCH, OPTIONS) should be rejected with a
411 Length Required
if they don't include aContent-Length
orTransfer-Encoding: chunked
header.The text was updated successfully, but these errors were encountered: