From: Willy Tarreau Date: Thu, 23 Apr 2026 09:00:11 +0000 (+0200) Subject: BUG/MINOR: compression: properly disable request when setting response X-Git-Tag: v3.4-dev10~81 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=055726a4c94535aa9aeec435aa8145070f2106b8;p=haproxy.git 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. --- 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;