BUG/MINOR: cache: A 'max-age=0' cache-control directive can be overriden by a s-maxage

When a s-maxage cache-control directive is present, it overrides any
other max-age or expires value (see section 5.2.2.9 of RFC7234). So if
we have a max-age=0 alongside a strictly positive s-maxage, the response
should be cached.

This bug was raised in GitHub issue #2203.
The fix can be backported to all stable branches.

(cherry picked from commit ca4fd73938f3eeb7bb81bc85d49b3076e2e26178)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 02f47244f3e474ba5a1baf8afffa9ad0b5921235)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 7340985c554b6fd791a5de6c540ffbe08d3207ea)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 49cbae91937f5f4fd478c6859ba5d271afcc698c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
2 files changed