httpcompressiongzipchunkedhttp-chunked

Tiny web server without compressed transfer encoding


I am working on a very constrained device that has TCP support, and I want to support HTTP/1.1 but eliminate all of the compression support to make it fit the device limitations.

If a client sends compressed transfer encoding, which HTTP response status should be returned by the server to indicate it only accepts non-compressed chunks?


Solution

  • From RFC 7230, section 3.3.1:

    A server that receives a request message with a transfer coding it does not understand SHOULD respond with 501 (Not Implemented).

    For content codings consult RFC 7231, section 3.1.2.1:

    An origin server MAY respond with a status code of 415 (Unsupported Media Type) if a representation in the request message has a content coding that is not acceptable.