Description
In the following scenario with an If-Modified-Since (IMS)/If-None-Match request from the client:
client IMS request -> | TS
TS IMS request -> | origin
TS | <- origin 200 response
client | <- TS 304 response
When the origin's response to TS is chunked, TS sends a "Transfer-Encoding: chunked" header with the 304 response to the client without any body or 0 chunk. This, from my reading of the RFC appears to be valid ("The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.").
However, curl (7.16.3) complains and initiates a close when it gets a response with Transfer-Encoding: chunked with no body. To avoid confusion TS should not send Transfer-Encoding header for responses with an empty body.