summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Lallemand <wlallemand@haproxy.org>2021-08-24 17:53:03 +0200
committerWilliam Lallemand <wlallemand@haproxy.org>2021-08-24 17:53:03 +0200
commit4463b17fe354fda18b194bdad862df52af29fb79 (patch)
treea52390476e291dcc85bedc4fa2031e06899f05b1
parent211c9679c8c10f6a09f95c2aa613225887607850 (diff)
downloadhaproxy-4463b17fe354fda18b194bdad862df52af29fb79.tar.gz
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.
-rw-r--r--src/http_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http_client.c b/src/http_client.c
index fad3368f3..f6621a6db 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;