From: William Lallemand Date: Mon, 20 Sep 2021 14:19:15 +0000 (+0200) Subject: MINOR: httpclient: add the EOH when no headers where provided X-Git-Tag: v2.5-dev8~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79a3478c24ab0aa4e854e9225527a8cae4938a3d;p=thirdparty%2Fhaproxy.git MINOR: httpclient: add the EOH when no headers where provided httpclient_req_gen() now adds the end of headers block when no header was provided, which avoid adding it manually. --- diff --git a/src/http_client.c b/src/http_client.c index debdee5d36..69297e1363 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -283,8 +283,13 @@ int httpclient_req_gen(struct httpclient *hc, const struct ist url, enum http_me goto error; /* add the headers and EOH */ - if (hdrs && !htx_add_all_headers(htx, hdrs)) - goto error; + if (hdrs) { + if (!htx_add_all_headers(htx, hdrs)) + goto error; + } else { + if (!htx_add_endof(htx, HTX_BLK_EOH)) + goto error; + } htx->flags |= HTX_FL_EOM;