]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: Skip some headers for http-check send rules
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Apr 2020 09:50:01 +0000 (11:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Apr 2020 11:32:29 +0000 (13:32 +0200)
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

index 2ca1aca933444fa59ed4b4204ac0d39aecc25320..3b22adabfdb558182565d9b81110a9974a466ffa 100644 (file)
@@ -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) {