]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cache: also recognize directives in the form "token="
authorWilly Tarreau <w@1wt.eu>
Sun, 24 May 2026 19:52:54 +0000 (21:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2026 11:13:24 +0000 (13:13 +0200)
commit73472025f2ffd55595e0c1f3dfc600cecb57fbbd
tree045111311c6002438465944940aefea54a48b113
parent5cb932826d8dd7e78df19ea8f59a07a744e923e6
BUG/MINOR: cache: also recognize directives in the form "token="

The caching RFC (9111, but was present since 2616) indicate that
cache-control supports both the "token" and "token=..." forms and that
consumers are supposed to recognize both. In addition, "private=..." is
explicitly mentioned, so servers could very well emit it. However,
haproxy only recognizes the short form without argument, except for
"no-cache" where it also supports it followed by the beginning of a
set-cookie argument. Thus it could miss "private=" or "no-store=".

Let's refine the checks. Now we explicitly recognize the form
no-cache="set-cookie", and all variants of "token" or "token=" as
identical to disable caching. It will more reliably catch such edge
cases and make sure we never cache a response marked like this.

This should be backported, at least to the latest LTS (3.2), maybe
further after some observation.
src/http_ana.c