]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: properly detect max-age=0 and s-maxage=0 in responses
authorWilly Tarreau <w@1wt.eu>
Fri, 22 Dec 2017 14:35:11 +0000 (15:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 22 Dec 2017 14:49:15 +0000 (15:49 +0100)
commitd3900cc31d4ca14a9c45902b2543da2f39ce2c26
tree0972b19068c79955a616d96d175fcd7694dc1bef
parent12b32f212f4c7457eeae37edb06dd0a06995fce1
BUG/MINOR: http: properly detect max-age=0 and s-maxage=0 in responses

In 1.3.8, commit a15645d ("[MAJOR] completed the HTTP response processing.")
improved the response parser by taking care of the cache-control header
field. The parser is wrong because it is split in two parts, one checking
for elements containing an equal sign and the other one for those without.
The "max-age=0" and "s-maxage=0" tests were located at the wrong place and
thus have never matched. In practice the side effect was very minimal given
that this code used to be enabled only when checking if a cookie had the
risk of being cached or not. Recently in 1.8 it was also used to decide if
the response could be cached but in practice the cache takes care of these
values by itself so there is very limited impact.

This fix can be backported to all stable versions.
src/proto_http.c