]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hq-interop: adjust parsing/encoding on backend side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Sep 2025 09:20:25 +0000 (11:20 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Sep 2025 14:55:09 +0000 (16:55 +0200)
HTTP/0.9 is available on top of QUIC. This protocol is reserved for
internal use, mostly interop purpose.

This patch adjusts HTTP/0.9 layer with the following changes :
* version is not emitted anymore on the status line. This is performed
  as some servers does not parse it correctly.
* status line is set explicitely on HTX status-line. This ensures the
  correct HTTP status code is reported to the upper stream layer.

This does not need to be backported.

src/hq_interop.c

index 3ded462668239737bf173d5b5d4ba455356bcff7..74240a1f79bd1456d43c6a11e2f5b33fc8251819 100644 (file)
@@ -115,6 +115,7 @@ static ssize_t hq_interop_rcv_buf_res(struct qcs *qcs, struct buffer *b, int fin
                sl = htx_add_stline(htx, HTX_BLK_RES_SL, flags,
                                    ist("HTTP/1.0"), ist("200"), ist(""));
                BUG_ON(!sl);
+               sl->info.res.status = 200;
                if (fin && !to_copy)
                        sl->flags |= HTX_SL_F_BODYLESS;
                htx_add_endof(htx, HTX_BLK_EOH);
@@ -200,7 +201,7 @@ 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));
-                       b_putist(res, ist(" HTTP/0.9\r\n"));
+                       b_putist(res, ist("\r\n"));
                        htx_remove_blk(htx, blk);
                        total += fsize;
                        break;