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.
This commit is contained in:
William Lallemand
2021-08-24 17:53:03 +02:00
parent 211c9679c8
commit 4463b17fe3

View File

@@ -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;