]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cache: Manage multiple headers in accept-encoding normalization
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 23 Dec 2020 17:13:46 +0000 (18:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Dec 2020 16:18:00 +0000 (17:18 +0100)
commite4421dec7e63ff275c3a0788a0ae31e2d851da82
treec9b759f6de16afec8efef27b6f6c689f89adb218
parent2b5c5cbef6bfac8effa6afa7e3a49d215d3cc60a
BUG/MINOR: cache: Manage multiple headers in accept-encoding normalization

The accept-encoding part of the secondary key (vary) was only built out
of the first occurrence of the header. So if a client had two
accept-encoding headers, gzip and br for instance, the key would have
been built out of the gzip string. So another client that only managed
gzip would have been sent the cached resource, even if it was a br resource.
The http_find_header function is now called directly by the normalizers
so that they can manage multiple headers if needed.
A request that has more than 16 encodings will be considered as an
illegitimate request and its response will not be stored.

This fixes GitHub issue #987.

It does not need any backport.
reg-tests/cache/vary.vtc
src/cache.c