From: William Lallemand Date: Tue, 24 Aug 2021 15:53:03 +0000 (+0200) Subject: BUG/MINOR: httpclient: fix Host header X-Git-Tag: v2.5-dev5~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4463b17fe354fda18b194bdad862df52af29fb79;p=thirdparty%2Fhaproxy.git BUG/MINOR: httpclient: fix Host header THe http_update_update_host function takes an URL and extract the domain to use as a host header. However it only update an existing host header and does not create one. This patch add an empty host header so the function can update it. --- diff --git a/src/http_client.c b/src/http_client.c index fad3368f36..f6621a6db9 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -276,6 +276,8 @@ int httpclient_req_gen(struct httpclient *hc, const struct ist url, enum http_me sl->info.req.meth = meth; /* Add Host Header from URL */ + if (!htx_add_header(htx, ist("Host"), IST_NULL)) + goto error; if (!http_update_host(htx, sl, url)) goto error;