From 055726a4c94535aa9aeec435aa8145070f2106b8 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 23 Apr 2026 11:00:11 +0200 Subject: [PATCH] BUG/MINOR: compression: properly disable request when setting response In 2.8, commit ead43fe4f2 ("MEDIUM: compression: Make it so we can compress requests as well.") added the ability to independently enable compression on request and/or response. However there's a bug in the "compression direction response" case, which preserves only the request flag and adds the response direction instead of clearing the request flag, so this directive would clear offload and make it impossible to disable request if it was already previously enabled. This can be backported to stable releases as far as 2.8. --- src/flt_http_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 50a389c51..bd5117097 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -997,7 +997,7 @@ parse_compression_options(char **args, int section, struct proxy *proxy, comp->flags &= ~COMP_FL_DIR_RES; comp->flags |= COMP_FL_DIR_REQ; } else if (strcmp(args[2], "response") == 0) { - comp->flags &= COMP_FL_DIR_REQ; + comp->flags &= ~COMP_FL_DIR_REQ; comp->flags |= COMP_FL_DIR_RES; } else if (strcmp(args[2], "both") == 0) comp->flags |= COMP_FL_DIR_REQ | COMP_FL_DIR_RES;