How does a HTTP/1.1 client know where a message ends in presence of `Connection: keep-alive` header field but absence of `Content-Length`?
特别是,我有一个来自nginx服务器的响应头:
1 2 3 4 5 6 7 8 | HTTP/1.1 200 OK Server: nginx/1.10.3 (Ubuntu) Date: Tue, 20 Mar 2018 10:28:24 GMT Content-Type: text/html Last-Modified: Thu, 28 Jan 2016 10:50:21 GMT Connection: keep-alive ETag: W/"56a9f26d-2d97" Content-Encoding: gzip |
然后是大约3352字节的压缩数据。我正在尝试找出客户机如何知道消息体的结束位置和新的响应开始。
它没有。响应需要一个Content-Length响应头字段,或者必须使用"Transfer-Encoding:Chunked"。