BUG/MINOR: httpclient: allow to replace the host header
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 24 Nov 2021 14:38:17 +0000 (15:38 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 24 Nov 2021 15:36:16 +0000 (16:36 +0100)
commite27970ba2345fba86dbe37a8754c4edae0de66a9
tree7d09adbc3a8e738f220f22fb7aaf82f9b511ef2a
parentdd1cdd9f4d62456478d324610044154633553f54
BUG/MINOR: httpclient: allow to replace the host header

This patch allows to replace the host header generated by the
httpclient instead of adding a new one, resulting in the server replying
an error 400.

The host header is now generated from the uri only if it wasn't found in
the list of headers.

Also add a new request in the VTC file to test this.

This patch must be backported in 2.5.

(cherry picked from commit f03b53c81d52344c29d7a5434ac32f3127cebf75)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
reg-tests/lua/lua_httpclient.lua
reg-tests/lua/lua_httpclient.vtc
src/http_client.c