MINOR: cache: Add Expires header value parsing
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 28 Oct 2020 16:52:53 +0000 (17:52 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 30 Oct 2020 10:08:38 +0000 (11:08 +0100)
commita6476114ec6b9e6338b524e0099dbdda28614d36
tree4ffb18e64ed2d89a68d55e7097ead27f32207169
parentbc0af6a19947c7ab76bd226beaaaafedc0648be4
MINOR: cache: Add Expires header value parsing

When no Cache-Control max-age or s-maxage information is present in a
cached response, we need to parse the Expires header value (RFC 7234#5.3).
An invalid Expires date value or a date earlier than the reception date
will make the cache_entry stale upon creation.
For now, the Cache-Control and Expires headers are parsed after the
insertion of the response in the cache so even if the parsing of the
Expires results in an already stale entry, the entry will exist in the
cache.
reg-tests/cache/expires.vtc [new file with mode: 0644]
src/cache.c