]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: hq-interop: support transcoding of absolute URI
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 29 Jun 2026 11:56:17 +0000 (13:56 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 29 Jun 2026 14:04:57 +0000 (16:04 +0200)
On the backend side, HTTP/0.9 transcoder is responsible to convert a HTX
request into a HTTP start line. In particular, path is generated from
the HTX request URI.

However, an absolute URI was not converted correctly in a HTTP/0.9
simple path. This occurs notably in most cases when using HTTP/2 or 3 on
the frontend side.

This issue was detected when running QUIC interop. Some servers
implementation such as picoquic would reject these requests as they are
considered invalid.

To adjust this, extract the path component from HTX uri using
http_uri_parser API.

This should be backported up to 3.3 as this is a QUIC backend fix.

src/hq_interop.c

index a6ccfbddd6408322934d2c7f27084e51c48f1460..4602cc7e5bfc954353b4065c507c8b8733117d71 100644 (file)
@@ -202,6 +202,7 @@ static size_t hq_interop_snd_buf(struct qcs *qcs, struct buffer *buf,
        struct htx *htx = NULL;
        struct htx_blk *blk;
        struct htx_sl *sl = NULL;
+       struct http_uri_parser uri_parser;
        int32_t idx;
        uint32_t bsize, fsize;
        struct buffer *res = NULL;
@@ -234,7 +235,8 @@ static size_t hq_interop_snd_buf(struct qcs *qcs, struct buffer *buf,
 
                        /* Only GET supported for HTTP/0.9. */
                        b_putist(res, ist("GET "));
-                       b_putist(res, htx_sl_req_uri(sl));
+                       uri_parser = http_uri_parser_init(htx_sl_req_uri(sl));
+                       b_putist(res, http_parse_path(&uri_parser));
                        b_putist(res, ist("\r\n"));
                        htx_remove_blk(htx, blk);
                        total += fsize;