Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: