]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: filters: order the implicit filters around the explicit ones
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Nov 2026 10:17:57 +0000 (11:17 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Nov 2026 17:20:31 +0000 (18:20 +0100)
commit4930d112a2a20120f053af0cdc106d13b3c07bc3
tree82b1399ef467f960314869f59d4c6d6de093e124
parent15a89ceed3ddeae597f25be7b38748f6a1d2774f
BUG/MEDIUM: filters: order the implicit filters around the explicit ones

In the legacy filter mode, flt_reorder_implicit_conf() reordered the
implicitly declared core filters but pinned the explicitly declared core
filters in their declaration position, treating them as segment
boundaries. An implicit filter bucketed after an explicit core filter
ended up in a wrong position: with an explicit "filter compression"
declaration followed by cache rules, the implicit cache-store filter
was placed after the compression filters, and the configuration checks
reported bogus errors:

    proxy 'li': unable to enable the compression filter on response
                before any cache filter.
    proxy 'li': unable to enable the compression filter before the
                cache 'c'.

while this configuration is valid: the implicit cache filter must be
placed at its canonical position, before the explicit compression
filters.

Explicitly declared core filters are now placed in the "any other
filter" class, like any explicitly declared filter: their manual
placement among the explicit filters is the user's responsibility, and
only the implicitly declared core filters are moved to their canonical
position. The placement policy is implemented in flt_order_class(),
which returns the "any other filter" class for an explicit core filter.

The order checks reporting conflicts between the compression,
decompression and cache filters are updated accordingly: an order
error is only reported when the filters involved are explicitly
declared. A filter that is automatically ordered never conflicts with
an explicitly declared one, since the reordering places them correctly
relative to each other.

No backport needed.
src/cache.c
src/filters.c
src/flt_decomp.c
src/flt_http_comp.c