]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h3: fix https scheme request encoding for BE side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Jul 2025 15:30:29 +0000 (17:30 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 9 Jul 2025 15:41:34 +0000 (17:41 +0200)
An HTTP/3 request must contains :scheme pseudo-header. Currently, only
"https" value is expected due to QUIC transport layer in use.

However, https value is incorrectly encoded due to a QPACK index value
mismatch in qpack_encode_scheme(). Fix it to ensure that scheme is now
properly set for HTTP/3 requests on the backend side.

No need to backport this.

src/qpack-enc.c

index 7766bb616b07d970a04f8069b7e30ccf596d670b..311d2ae2053d049edfbe8f8803fae8fae9d6d41e 100644 (file)
@@ -191,10 +191,10 @@ int qpack_encode_scheme(struct buffer *out, const struct ist scheme)
                        b_putchr(out, istptr(scheme)[i]);
        }
        else {
-               int idx = 23;
+               const int idx = isteq(scheme, ist("https")) ?
+                 23 : /* :scheme: https */
+                 22;  /* :scheme: http */
 
-               if (unlikely(!isteq(scheme, ist("http"))))
-                       idx = 22;
                if (b_room(out) < 2)
                        return 1;