]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: fcgi-app: allow explicit filter declaration with non-cache/non-compression...
authorAustin Kauffman <akauffman@ne4u.com>
Sat, 15 Aug 2026 01:34:39 +0000 (18:34 -0700)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 26 Aug 2026 12:26:56 +0000 (14:26 +0200)
commitfa196bc1de290721d8cba67b56d83947e91739a5
treec8ff27f560e22d675e21ff11f1754cfd6e1ea382
parent34dbc5e69fb1f59d4fc0614e8402c12cf489b595
BUG/MINOR: fcgi-app: allow explicit filter declaration with non-cache/non-compression filters

fcgi_flt_check() in src/fcgi-app.c unconditionally rejects any filter that
isn't compression, cache, or fcgi-app from coexisting with use-fcgi-app in
the same backend section, regardless of whether an explicit
`filter fcgi-app <name>` declaration is present. This contradicts the
documentation (section 9.5 of configuration.txt), which states that an
explicit `filter fcgi-app` declaration should allow other filters to
coexist.

The cache filter's equivalent check (cache_store_check in src/cache.c)
correctly uses a CACHE_FLT_F_IMPLICIT_DECL flag to only reject implicit
declarations when other filters are present. The fcgi-app check was missing
this flag, which appears to be an oversight.

This patch adds a FCGI_FLT_F_IMPLICIT_DECL flag to fcgi_flt_conf, mirroring
the cache filter's pattern:

  - The flag is set when use-fcgi-app creates an implicit filter
    (proxy_parse_use_fcgi_app).
  - The flag is cleared when filter fcgi-app explicitly declares the filter
    (parse_fcgi_flt), whether reusing an existing implicit config or
    creating a new one.
  - fcgi_flt_check only errors when the flag is set (i.e., the filter is
    implicit), matching cache_store_check's behavior.

This allows Lua-based filters (lua.resp_transform, lua.compress for
brotli/zstd) and other third-party filters to coexist with FastCGI backends
when an explicit `filter fcgi-app` declaration is present, as documented.

This should be backported to all versions that have the fcgi-app filter.
include/haproxy/fcgi-app-t.h
src/fcgi-app.c