Search code examples
httpchunked-encodingchunks

What are valid chunks extensions?


RFC 7230 defines chunked encoding and states :

The chunked encoding allows each chunk to include zero or more chunk extensions, immediately following the chunk-size, for the sake of supplying per-chunk metadata (such as a signature or hash), mid-message control information, or randomization of message body size.

But I can't find a list of these extensions, would someone know where to find it?


Solution

  • Chunk extensions are not pre-defined. You add custom extensions per your implementation requirements.

    Here is the quote from Wikipedia on how to format it:

    If chunk extensions are provided, the chunk size is terminated by a semicolon and followed by the parameters, each also delimited by semicolons. Each parameter is encoded as an extension name followed by an optional equal sign and value. These parameters could be used for a running message digest or digital signature, or to indicate an estimated transfer progress, for instance.

    Url to Wiki: https://en.wikipedia.org/wiki/Chunked_transfer_encoding