MEDIUM: cache: Remove cache entry in case of POST on the same resource
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 3 Dec 2020 17:19:31 +0000 (18:19 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 4 Dec 2020 09:21:56 +0000 (10:21 +0100)
commit72cffaf4405682d76e52dddfce57137b4a9cd395
tree9f0ed623f010de4d9ca8f54d74f67ddd57ba323c
parentfcea374fdfbba5af12349905dd45ae812a36284a
MEDIUM: cache: Remove cache entry in case of POST on the same resource

In case of successful unsafe method on a stored resource, the cached entry
must be invalidated (see RFC7234#4.4).
A "non-error response" is one with a 2xx (Successful) or 3xx (Redirection)
status code.
This implies that the primary hash must now be calculated on requests
that have an unsafe method (POST or PUT for instance) so that we can
disable the corresponding entries when we process the response.
reg-tests/cache/post_on_entry.vtc [new file with mode: 0644]
src/cache.c