From: Christopher Faulet Date: Thu, 19 Nov 2026 09:30:00 +0000 (+0100) Subject: BUG/MEDIUM: http-ana: restore the purge of backend analyzers on applets X-Git-Url: https://git.kaiwu.me/http/%22data:,/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=d574bddf36aa2e131721384e4d82ae3a291d2afa;p=haproxy.git BUG/MEDIUM: http-ana: restore the purge of backend analyzers on applets Commit 7568a0555 ("BUG/MINOR: http-ana: fix response compression for applets") introduced a regression. It removed the purge of the request analyzers performed when a request was intercepted by an applet, to only set AN_REQ_HTTP_INNER. The idea was that http_process_request() called on AN_REQ_HTTP_INNER configures all the analyzers needed to handle keep-alive and compression on the HTTP response. But doing so, some analyzers that were removed before the commit above, remain attached. One of them, AN_REQ_SWITCHING_RULES, is responsible to set a backend and all backend analyzers with it. So an request intercepted by an applet in the frontend is still branched to a backend with its analyzers armed. And they are evaluated against the intercepted request, as if it was forwarded to the backend. Thus the http-request rules of the unassigned backend are applied to the applet request. For instance, with a "http-request deny" rule in the backend, a request intercepted by the frontend stats applet is denied with a 403. So the purge of the backend analyzers is restored, to only keep the minimally required analyzers to handle keep-alive and compression on the HTTP response. But, unlike the antique code from 1.5-dev24, the inner processing is preserved: AN_REQ_HTTP_INNER is not removed by the purge because it is needed to enable compression of the applet response when the applet is branched from a backend. No backport is needed. --- diff --git a/src/http_ana.c b/src/http_ana.c index 01a59753b..0eb4721b6 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -503,6 +503,15 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s s->flags |= SF_ERR_LOCAL; // to mark that it comes from the proxy http_set_term_flags(s); + if (HAS_FILTERS(s)) + req->analysers |= AN_REQ_FLT_HTTP_HDRS; + + /* enable the minimally required analyzers to handle keep-alive and compression on the HTTP response */ + req->analysers &= AN_REQ_HTTP_BODY | AN_REQ_HTTP_INNER | + AN_REQ_FLT_HTTP_HDRS | AN_REQ_FLT_END; + req->analysers &= ~AN_REQ_FLT_XFER_DATA; + req->analysers |= AN_REQ_HTTP_XFER_BODY; + /* inner is usually set only during backend processing, and is * also needed for applets branched from frontends in order to * enable compression, cookie processing, unique-id generation,