Géry Ogam
Géry Ogam

Reputation: 8027

How to treat request messages without Transfer-Encoding nor Content-Length headers?

I am implementing a web server and I was wondering how to treat request messages with a message body but without Transfer-Encoding nor Content-Length headers (assuming the request method is not HEAD nor CONNECT of course).

According to RFC 7230, § 3.3.3. Message Body Length:

The length of a message body is determined by one of the following (in order of precedence):

[…]

  1. If this is a request message and none of the above are true, then the message body length is zero (no message body is present).

Am I in that case, and consequently should I consider the message body length is zero (even though it is not zero in reality)?

Upvotes: 0

Views: 49

Answers (1)

Julian Reschke
Julian Reschke

Reputation: 41997

The spec defines it. If there is no content-length nor chunked encoding, whatever follows the header section is the next request (possibly malformed).

Upvotes: 1

Related Questions