]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cache: Add support for 'If-None-Match' request header
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 22 Oct 2020 08:40:05 +0000 (10:40 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 22 Oct 2020 14:10:20 +0000 (16:10 +0200)
commit6cb10384a32cd0b85050556c85f9d18b2725d8e9
tree2a733ac9407817c8436ac998584349a42bc43a6d
parentdbb65b5a7a12ef637981f02150e26d821514870c
MEDIUM: cache: Add support for 'If-None-Match' request header

Partial support of conditional HTTP requests. This commit adds the
support of the 'If-None-Match' header (see RFC 7232#3.2).
When a client specifies a list of ETags through one or more
'If-None-Match' headers, they are all compared to the one that might have
been stored in the corresponding http cache entry until one of them
matches.
If a match happens, a specific "304 Not Modified" response is
sent instead of the cached data. This response has all the stored
headers but no other data (see RFC 7232#4.1). Otherwise, the whole cached data
is sent.
Although unlikely in a GET/HEAD request, the "If-None-Match: *" syntax is
valid and also receives a "304 Not Modified" response (RFC 7434#4.3.2).

This resolves a part of GitHub issue #821.
include/haproxy/applet-t.h
src/cache.c