]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: remove transfer-encoding header
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Feb 2022 15:10:42 +0000 (16:10 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 15 Feb 2022 16:08:22 +0000 (17:08 +0100)
According to HTTP/3 specification, transfer-encoding header must not be
used in HTTP/3 messages. Remove it when converting HTX responses to
HTTP/3.

src/h3.c

index e68665bb3310153045fb37a947ad0c7c0b10ade9..85eca90d7df0a4ff4e42594b91f390af5e2cf26a 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -468,6 +468,14 @@ static int h3_resp_headers_send(struct qcs *qcs, struct htx *htx)
                if (isteq(list[hdr].n, ist("")))
                        break;
 
+               /* draft-ietf-quic-http34 4.1. HTTP Message Exchanges
+                * Transfer codings (see Section 6.1 of [HTTP11]) are not
+                * defined for HTTP/3; the Transfer-Encoding header field MUST
+                * NOT be used.
+                */
+               if (isteq(list[hdr].n, ist("transfer-encoding")))
+                       continue;
+
                if (qpack_encode_header(&headers_buf, list[hdr].n, list[hdr].v))
                        ABORT_NOW();
        }