RFC 2616 states that the
Content-Length header must not be sent if a
Transfer-Encoding is present.
The Content-Length header field MUST NOT be sent if these two lengths are different (i.e., if a Transfer-Encoding header field is present).
However, if both headers are received, the client should ignore the
If a message is received with both a Transfer-Encoding header field and a Content-Length header field, the latter MUST be ignored.
Is my interpretation correct that the client should treat the case where both headers are present as a proper HTTP response? Or is this clause implementation specific?
I'm asking because the Go standard
net/http package returns an error when such scenario happens.