RE: What is Content-Length?

An alternate proposal, which I believe is simpler and requires less
modification:

Content-Length, if validly present, is the length of the entity-body (which
is the message-body after transfer codings are removed). It is also the
length of the message-body if no transfer-coding is used.
Content-Length MUST NOT be present if a transfer coding is used. If it is
present in such cases, it is invalid, and the robustness principle says it
should be ignored.

If we want, we can provide for the future existence of non-self-delimited
transfer codings by adding Transfer-length:

Transfer-Length, if validly present, is the length of the message-body.
Transfer-Length MUST NOT be present on self-delimiting transfer codings. If
it is present in this case, it is invalid, and the robustness principle says
it should be ignored.

Under these rules, Content-Length is still logically end-to-end -- the
header may not physically be present, but its value if it is ever present is
well-defined end-to-end and the same end-to-end.

Note that the definition of Content-length is independent of the existence
of Transfer-length, and we could omit it.

Under these rules, proxies may delete Content-length, as long as the add
Transfer-length or a self-delimited transfer coding. So, we remove it from
the list of "must not modify" headers.

Digest Auth should drop all reference to Content-Length and replaces it with
"length of entity-body", which is always well-defined and always
determinable given the above rules.

Paul

Received on Saturday, 13 December 1997 12:01:39 UTC