3 ms·
Isn't the size in the header? (Which yea, could be faked, or sent as Chunked) the USER-agent could just make a cap, and stop after 1mb when image/gif media type
by edoceo 6y ago
Isn't the size in the header? (Which yea, could be faked, or sent as Chunked) the USER-agent could just make a cap, and stop after 1mb when image/gif media type
- brabel 6y agoHTTP allows the body length to be specified in the header before the body is downloaded via the `Content-Length` header. It also allows you to stream the body in chunks by setting the `Transfer-Encoding` header to `chunked`, as you've mentioned, in which case each chunk starts with its own length. In both cases, the length cannot be faked because the recipient will stop pulling bytes after the specified length, as that's the purpose of sending such length (after there's no more bytes according to the latest length, the connection is free to be used for a subsequent response)!