]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: flt_http_comp: "compression" requires TCP or HTTP mode
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 19 Sep 2023 16:02:00 +0000 (18:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Oct 2023 13:34:30 +0000 (15:34 +0200)
Prevent the use of "compression" keyword in proxy sections when the proxy
is neither in tcp or http mode.

src/flt_http_comp.c

index d34b56a86de8e3ebb0ba4c41fd6dee8ca62018d1..becfa527853949e4d0b1857f825b46854651c244 100644 (file)
@@ -789,6 +789,12 @@ parse_compression_options(char **args, int section, struct proxy *proxy,
        else
                comp = proxy->comp;
 
+       if (proxy->mode != PR_MODE_TCP && proxy->mode != PR_MODE_HTTP) {
+               memprintf(err, "parsing [%s:%d] : '%s' requires TCP or HTTP mode.",
+                         file, line, args[0]);
+               ret = -1;
+               goto end;
+       }
        if (strcmp(args[1], "algo") == 0 || strcmp(args[1], "algo-res") == 0) {
                struct comp_ctx *ctx;
                int              cur_arg = 2;