From: Christopher Faulet Date: Fri, 19 Sep 2025 12:51:32 +0000 (+0200) Subject: BUG/MEDIUM: http-client: Fix the test on the response start-line X-Git-Tag: v3.3-dev9~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=331689d2167520ccd5c6098802db468fd9237e39;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http-client: Fix the test on the response start-line The commit 88aa7a780 ("MINOR: http-client: Trigger an error if first response block isn't a start-line") introduced a bug. From an endpoint, an applet or a mux, the index must never be used. It is reserved to the HTTP analyzers. From endpoint, this value may be undefined or just point on any other block that the first one. Instead we must always get the head block. In taht case, to be sure the first HTX block in a response is a start-line, we must use htx_get_head_type() function instead of htx_get_first_type(). Otherwise, we can trigger an error while the response is in fact properly formatted. It is a 3.3-speific issue. cNo backport needed. --- diff --git a/src/http_client.c b/src/http_client.c index d72d75ba3..7e6c805e5 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -653,7 +653,7 @@ void httpclient_applet_io_handler(struct appctx *appctx) /* copy the start line in the hc structure,then remove the htx block */ htx = htxbuf(inbuf); - if (htx_get_first_type(htx) != HTX_BLK_RES_SL) + if (htx_get_head_type(htx) != HTX_BLK_RES_SL) goto error; blk = DISGUISE(htx_get_head_blk(htx)); sl = htx_get_blk_ptr(htx, blk);