]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: flt-decomp: Report error about filter order in lagacy mode only
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Oct 2026 09:24:21 +0000 (11:24 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Oct 2026 09:24:22 +0000 (11:24 +0200)
Response decompression filter cannot be placed after the cache-store one
only in legacy mode. With the new model, it is no longer an error because
order is more explicit and easier to configure.

No backport needed

src/flt_decomp.c

index 8719479417942d2ca5435b9cffcf97f30fa21882..645b64ad17fd444eb57b2cfd8a35e355a5992d13 100644 (file)
@@ -1363,19 +1363,19 @@ static int decomp_check_order(struct flt_conf *f, void *data)
 
        if ((ctx->px->cap & PR_CAP_FE) && f->id == decomp_req_flt_id) {
                ctx->decomp_req_seen = 1;
-               return 0;
        }
-       if ((ctx->px->cap & PR_CAP_BE) && f->id == decomp_res_flt_id) {
-               if (ctx->cache_seen) {
-                       ha_alert("config: %s '%s': cache filter declared before a decompression filter on the response is invalid.\n",
-                                proxy_type_str(ctx->px), ctx->px->id);
-                       return 1;
+       else if (flt_use_legacy_filter(ctx->px)) {
+               if ((ctx->px->cap & PR_CAP_BE) && f->id == decomp_res_flt_id) {
+                       if (ctx->cache_seen) {
+                               ha_alert("config: %s '%s': cache filter declared before a decompression filter on the response is invalid.\n",
+                                        proxy_type_str(ctx->px), ctx->px->id);
+                               return 1;
+                       }
+                       ctx->decomp_res_seen = 1;
                }
-               ctx->decomp_res_seen = 1;
-               return 0;
+               if (f->id == cache_store_flt_id)
+                       ctx->cache_seen = 1;
        }
-       if (flt_use_legacy_filter(ctx->px) && f->id == cache_store_flt_id)
-               ctx->cache_seen = 1;
        return 0;
 }