News for hackers. Stuff that matters.
Re:Add extra stuff to a “standard” encoding? Sure, why not by kentonv on Wednesday September 20, 2023 @05:04PM (#37590151)
> FYI you should never trust the content-length of an HTTP request. It actually says that in one of the spec versions or another.

That's not quite right. When a Content-Length is present, it is always correct by definition (it is what determines the body size; there's no way for the body to be a different size). What you probably mean is that you shouldn't ever assume that a Content-Length is available, because an HTTP message can alternatively be encoded using Transfer-Encoding: chunked, in which case the length is not known upfront. That is true, but doesn't change my point: Either Content-Length or chunked transfer encoding serve to delimit the HTTP entity-body, which makes any other in-band delimiter redundant.

There are no comments on this comment yet.