Remi,
On 6/18/21 3:46 PM, Remi Tricot-Le Breton wrote:
please find a small fix for the 'Vary' support of the cache to
correctly handle the difference between a missing 'accept-encoding'
and an empty 'accept-encoding'.
Nice catch, I completely forgot about this case.
Frankly it's a bit dumb that there even is a difference between a
missing header and an empty header. And also that content-encoding is
opt-out instead of opt-in.
I found the issue, because HAProxy was serving me a gzip encoded
response from the cache when I was not providing an 'accept-encoding'
header and I initially wanted to report *that* as a bug report. Then I
noticed that this was intentional and that it is the expected behavior
based on the HTTP specification.
I would not be surprised if this case is not correctly handled by the
majority of HTTP clients out there, because most (all?) servers tend to
only serve compressed responses if the client explicitly indicates support.
After sending the patch to HAProxy I also patched the HTTP client
without compression support in our software to specify 'accept-encoding:
identity' to be on the safe side :-/
Best regards
Tim Düsterhus
Developer WoltLab GmbH
--
WoltLab GmbH
Nedlitzer Str. 27B
14469 Potsdam
Tel.: +49 331 96784338
duester...@woltlab.com
www.woltlab.com
Managing director:
Marcel Werk
AG Potsdam HRB 26795 P