0

In particular, I have this response header from an nginx server:

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

Followed by some 3352 Bytes of compressed data. I'm trying to find out how does the client know where the body of this message ends and a new response begins.

Peter Jankuliak
  • 3,464
  • 1
  • 29
  • 40

1 Answers1

1

It doesn't. The response requires either a Content-Length response header field, or it has to use "Transfer-Encoding: chunked".

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
  • You're right. I generated the above HTTP header with `curl -I ` (which sends the HEAD request) [instead of `curl -sD - -o /dev/null`](https://stackoverflow.com/q/10060098/273348) and so the response was missing the `Transfer-Encoding: chunked` header field. – Peter Jankuliak Mar 21 '18 at 08:47