From 331689d2167520ccd5c6098802db468fd9237e39 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 19 Sep 2025 14:51:32 +0200 Subject: [PATCH] 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. --- src/http_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);