]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: do not ignore cache-control: public
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Dec 2017 15:08:09 +0000 (16:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 22 Dec 2017 13:43:26 +0000 (14:43 +0100)
commit12b32f212f4c7457eeae37edb06dd0a06995fce1
tree571c442cc5e5e0383f54412af33bf88d7f716ae1
parent83ece462b433b7b354036e33e810d1e8264d9c1f
BUG/MINOR: http: do not ignore cache-control: public

In check_response_for_cacheability(), we don't check the
cache-control flags if the response is already supposed not to be
cacheable. This was introduced very early when cache-control:public
was not checked, and it basically results in this last one not being
able to properly mark the response as cacheable if it uses a status
code which is non-cacheable by default. Till now the impact is very
limited as it doesn't check that cookies set on non-default status
codes are not cacheable, and it prevents the cache from caching such
responses.

Let's fix this by doing two things :
  - remove the test for !TX_CACHEABLE in the aforementionned function
  - however take care of 1xx status codes here (which used to be
    implicitly dealt with by the test above) and remove the explicit
    check for 101 in the caller

This fix must be backported to 1.8.
src/proto_http.c