From 267892881d01c0edfb0faee4e398861409687c8d Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 4 Feb 2026 11:09:39 +0900 Subject: [PATCH 1/2] Switch encoding preference from client controlled to server Signed-off-by: Anuraag Agrawal --- docs/protocol.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/protocol.md b/docs/protocol.md index dc1f5597..008d4ba3 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -181,11 +181,12 @@ 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. +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 From c642b975e3f6391a5aec1fcc1673fe947203b282 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 4 Feb 2026 13:22:08 +0900 Subject: [PATCH 2/2] Examples Signed-off-by: Anuraag Agrawal --- docs/protocol.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/protocol.md b/docs/protocol.md index 008d4ba3..25084ffc 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -185,6 +185,13 @@ 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.