]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: httpclient: fix resolution with port
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 26 Aug 2022 14:45:13 +0000 (16:45 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 26 Aug 2022 15:00:22 +0000 (17:00 +0200)
Fix the resolution in the httpclient when a port is associated to a
domain. The do-resolve action doesn't support a port in its input.

Must be backported to 2.6. Require the "host_only" converter to be
backported.

src/http_client.c

index cd93ade9a7f87bf350a3ae80c24dd98a4e5a03bf..3fffdbf13bbb9e56d94047937ad081908a4644bb 100644 (file)
@@ -1070,7 +1070,7 @@ static int httpclient_resolve_init()
        char *do_resolve = NULL;
        char *http_rules[][11] = {
               { "set-var(txn.hc_ip)", "dst", "" },
-              { do_resolve, "hdr(Host),lower", "if", "{", "var(txn.hc_ip)", "-m", "ip", "0.0.0.0", "}", "" },
+              { do_resolve, "hdr(Host),host_only", "if", "{", "var(txn.hc_ip)", "-m", "ip", "0.0.0.0", "}", "" },
               { "return", "status", "503", "if", "{", "var(txn.hc_ip)", "-m", "ip", "0.0.0.0", "}", "" },
               { "capture", "var(txn.hc_ip)", "len", "40", "" },
               { "set-dst", "var(txn.hc_ip)", "" },