BUG/MEDIUM: cache: Fix hash collision in `accept-encoding` handling for `Vary`
authorTim Duesterhus <tim@bastelstu.be>
Tue, 29 Dec 2020 11:43:53 +0000 (12:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Dec 2020 08:39:08 +0000 (09:39 +0100)
commitdc38bc4a1aecae55008b8bc472c4ff81302ad7df
treec531165c319a4c866db4a790fcaa5b2787ae3928
parent64b6f367882acf8b82c634e19fb5e3d0e64d11ef
BUG/MEDIUM: cache: Fix hash collision in `accept-encoding` handling for `Vary`

This patch fixes GitHub Issue #988. Commit ce9e7b25217c46db1ac636b2c885a05bf91ae57e
was not sufficient, because it fell back to a hash comparison if the bitmap
of known encodings was not acceptable instead of directly returning the the
cached response is not compatible.

This patch also extends the reg-test to test the hash collision that was
mentioned in #988.

Vary handling is 2.4, no backport needed.
reg-tests/cache/vary.vtc
reg-tests/cache/vary_accept_encoding.vtc
src/cache.c