accept data with “Transfer-Encoding: chunked”
Many HTTP frameworks will automatically encode data streams using the aforementioned method. I propose this behavior for Icecast:
- check if the protocol is not
HTTP/1.1
or there is noTransfer-Encoding
header, continue as in the past (i.e. assumeidentity
encoding) - if the
Transfer-Encoding
header is present and it isidentity
, continue as in the past - if the
Transfer-Encoding
header is present and it ischunked
, accept the data and strip the encoding information both from the output stream and from the dumpfile - if the
Transfer-Encoding
header is present and has a different value, terminate the request with 501 (Unimplemented) and provide an HTTP response body listing the supported encodings (in case developers need to debug this).
That behavior in compliant with RFC2616 (Section 3.6) and RFC7230 (Section 3.3.1).