]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: cache: Vary not working properly on anything other than accept-encoding
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 24 Apr 2024 12:32:19 +0000 (14:32 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 29 Apr 2024 08:41:46 +0000 (10:41 +0200)
commit0610f52bcd0a4bc7d13f92072786617f46298818
treedf271ef0f065455b4f597756711bb6d0f63a232d
parentba0f8b5330322d58d08b88ffd385b3aabf48dd57
BUG/MEDIUM: cache: Vary not working properly on anything other than accept-encoding

If a response varies on anything other than accept-encoding (origin or
referer) but still contains an 'Encoding' header, the cached responses
were never sent back.
This is because of the 'set_secondary_key_encoding' call that always
filled the accept-encoding part of the secondary signature with the
response's actual encoding, regardless of whether the response varies on
this or not. This meant that the accept-encoding part of the signature
could be non-null in the cached entry which made the
'get_secondary_entry' calls in 'http_action_req_cache_use' always fail
because in those cases the request's secondary signature always had a
null accept-encoding part.

This patch can be backported up to branch 2.4.
src/cache.c