From: Christopher Faulet Date: Tue, 8 Jul 2025 06:38:31 +0000 (+0200) Subject: BUG/MINOR: http-client: Ignore 1XX interim responses in non-HTX mode X-Git-Tag: v3.0.12~84 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=552ea76e0b3e51a2df9d4d2244ad367095dbf1dd;p=haproxy-3.0.git BUG/MINOR: http-client: Ignore 1XX interim responses in non-HTX mode When the response is re-formatted in raw message, the 1XX interim responses must be skipped. Otherwise, information of the first interim response will be saved (status line and headers) and those from the final response will be dropped. Note that for now, in HTX-mode, the interim messages are removed. This patch must be backported as far as 2.6. (cherry picked from commit 9d10be33aebb08058c37d7dcd15874e42be74a29) Signed-off-by: Amaury Denoyelle (cherry picked from commit 8abebc8d061c29dcdf511efba2321cf2a6df00d6) Signed-off-by: Christopher Faulet (cherry picked from commit 39b319f6c9d615c546631ea918daff11684c7b1b) Signed-off-by: Christopher Faulet --- diff --git a/src/http_client.c b/src/http_client.c index 6d7d5ef..d8d33bf 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -834,6 +834,23 @@ void httpclient_applet_io_handler(struct appctx *appctx) if (!sl || (!(sl->flags & HTX_SL_F_IS_RESP))) goto out; + /* Skipp any 1XX interim responses */ + if (sl->info.res.status < 200 && + (sl->info.res.status == 100 || sl->info.res.status >= 102)) { + while (blk) { + enum htx_blk_type type = htx_get_blk_type(blk); + uint32_t sz = htx_get_blksz(blk); + + c_rew(res, sz); + blk = htx_remove_blk(htx, blk); + if (type == HTX_BLK_EOH) { + htx_to_buf(htx, &res->buf); + break; + } + } + break; + } + /* copy the status line in the httpclient */ hc->res.status = sl->info.res.status; hc->res.vsn = istdup(htx_sl_res_vsn(sl));