]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: httpclient: add the EOH when no headers where provided
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 20 Sep 2021 14:19:15 +0000 (16:19 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 20 Sep 2021 14:24:54 +0000 (16:24 +0200)
httpclient_req_gen() now adds the end of headers block when no header
was provided, which avoid adding it manually.

src/http_client.c

index debdee5d36be05f2fafbe4caebbd78a4087683e2..69297e1363ab6e0f549ab10974807b8b212a68ec 100644 (file)
@@ -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;