Christoph Zurnieden: content-length:0 bei Keep-Alive?

Beitrag lesen

Hallo zusammen,

eigentlich eine selten dämliche Frage meint man, oder?
Aber die RFC 2616 ist, wie fast jede RFC, schwer verständlich und daher oft auch mißverständlich, wiedersprüchlich und ungenau. So auch hier.

HTTP/1.1 geht davon aus, daß jede Verbindung dauerhaft wäre:

8.1.2 Overall Operation

A significant difference between HTTP/1.1 and earlier versions of
HTTP is that persistent connections are the default behavior of any
HTTP connection. That is, unless otherwise indicated, the client
SHOULD assume that the server will maintain a persistent connection,
even after error responses from the server.
[...]

Sowie noch:

8.1.2.1 Negotiation

An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to
   maintain a persistent connection unless a Connection header including
   the connection-token "close" was sent in the request. If the server
   chooses to close the connection immediately after sending the
   response, it SHOULD send a Connection header including the
   connection-token close.
[...]

Der Keep-Alive Header ist demnach eine Beschränkung dieser Dauerhaftigkeit, keine explizite Anforderung von Dauerhaftigkeit.

Nun sagt aber die RFC etwas weiter in 8.1.2.1:

In order to remain persistent, all messages on the connection MUST
have a self-defined message length (i.e., one not defined by closure
of the connection), as described in section 4.4.

Nun ist die Frage: Muß ein GET ohne Body ein Content-Length:0 mitschicken, oder nicht?
(Kurzer Praxistest: Mozilla 1.1 macht es z.B. nicht)

so short

Christoph Zurnieden