What indicates the end of an HTTP Response, without having a Content-Length
header?
I\'ve read that in some case, that server closes the TCP connection.
If both the client and the server support HTTP 1.1, and the server does not know the response body size in advance (and therefore cannot send the Content-Length
response header), the server should use chunked encoding, which allows the client to find the end of the response body even if the server does not close the TCP connection immediately after sending the response.
If HTTP 1.1 cannot be used (because either the client or the server is too old), the chunked encoding cannot be used, and in such cases sending a response without the Content-Length
header prevents the server from keeping the TCP connection persistent.