diff --git a/docs/protocol.md b/docs/protocol.md index dc1f5597..25084ffc 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -181,11 +181,19 @@ If the client omits **Accept-Encoding**, servers must assume that the client accepts the **Content-Encoding** used for the request if present. Servers must assume that all clients accept "identity" as their least preferred encoding, even when **Accept-Encoding** is omitted. Servers should treat **Accept-Encoding** -as an ordered list, with the client's most preferred encoding first and least -preferred encoding last. This is a simplification fo standard HTTP semantics -that excludes quality values. If the client uses an unsupported **Content-Encoding**, -servers should return an error with code "unimplemented" and a message listing the -supported encodings. +as a list of equal preference and decide an appropriate encoding based on it. +This is a simplification fo standard HTTP semantics that excludes quality values. +If a user configures a server with an ordered list of encodings, it should be compared +in order to client's **Accept-Encoding** to determine the encoding for a response. + +For example, if the client's **Accept-Encoding** is **gzip,br,zstd**, + +- If the server is configured with **gzip**, the selected encoding is **gzip** +- If the server is configured **gzip,zstd,br**, the selected encoding is **gzip** +- If the server is configured **br,zstd,gzip**, the selected encoding is **br** + +If the client uses an unsupported **Content-Encoding**, servers should return an +error with code "unimplemented" and a message listing the supported encodings. If **Timeout** is omitted, the server should assume an infinite timeout. The protocol accommodates timeouts of more than 100 days. Client implementations