From: Christopher Faulet Date: Wed, 29 Apr 2020 09:50:01 +0000 (+0200) Subject: MINOR: checks: Skip some headers for http-check send rules X-Git-Tag: v2.2-dev7~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d765dbe9ae46d3ce1dc1ae1999c733f6a6e7085;p=thirdparty%2Fhaproxy.git MINOR: checks: Skip some headers for http-check send rules Connection, content-length and transfer-encoding headers are ignored for http-check send rules. For now, the keep-alive is not supported and the "connection: close" header is always added to the request. And the content-length header is automatically added. --- diff --git a/src/checks.c b/src/checks.c index 2ca1aca933..3b22adabfd 100644 --- a/src/checks.c +++ b/src/checks.c @@ -3785,10 +3785,15 @@ static struct tcpcheck_rule *parse_tcpcheck_send_http(char **args, int cur_arg, } host_hdr = i; } + else if (strcasecmp(args[cur_arg+1], "connection") == 0 || + strcasecmp(args[cur_arg+1], "content-length") == 0 || + strcasecmp(args[cur_arg+1], "transfer-encoding") == 0) + goto skip_hdr; hdrs[i].n = ist2(args[cur_arg+1], strlen(args[cur_arg+1])); hdrs[i].v = ist2(args[cur_arg+2], strlen(args[cur_arg+2])); i++; + skip_hdr: cur_arg += 2; } else if (strcmp(args[cur_arg], "body") == 0) {