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.

(cherry picked from commit 0610f52bcd0a4bc7d13f92072786617f46298818)
Signed-off-by: William Lallemand <wlallemand@haproxy.com>
(cherry picked from commit f77626b45204989afe52fa987fab4b391797f684)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit da7f2707fc99a603de16aa50cc9607c7143ab3da)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit a290e93da3af364b994992e2ae168f056265f7c2)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
1 file changed