From 7d765dbe9ae46d3ce1dc1ae1999c733f6a6e7085 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 29 Apr 2020 11:50:01 +0200 Subject: [PATCH] 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. --- src/checks.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/checks.c b/src/checks.c index 2ca1aca93..3b22adabf 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) {