AWS Application Load Balancer rejecting requests with content-length 0

332 views Asked by At

I'm having some issues sending a GET request to a service that contains no body and in the headers Content-Length:0 (ALB returns 400 bad request). By looking at AWS documentation they state that is classified as Acceptable enter image description here

where the definition of Acceptable is found here:

  • Acceptable — Request does not comply with RFC 7230 but poses no known security threats.

I browsed a bit through the RFC and and the only thing I found is this statement:

  • A user agent SHOULD NOT send a Content-Length header field when the request message does not contain a payload body AND the method semantics do not anticipate such a body.

I bolded out the key words that make a GET request with no body and with Content-Length:0 compliant with RFC 7230.

Do you understand why AWS says it's not compliant ?

EDIT: ALB is configured in Strictest mode for the desync mitigation mode configuration and treats Acceptable requests as blocked enter image description here

0

There are 0 answers