MEDIUM: cache: Add "Origin" header to secondary cache key
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 3 Oct 2023 12:33:41 +0000 (14:33 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 5 Oct 2023 08:53:54 +0000 (10:53 +0200)
commita5e96425a2819959fe2c6cffcec392beb858dd2c
treea22e3ad54fc8baa4f0bbe9224d8f7f04eb745e6a
parent544e320f8093f74403a7826770304c7f5705db9a
MEDIUM: cache: Add "Origin" header to secondary cache key

This patch add a hash of the Origin header to the cache's secondary key.
This enables to manage store responses that have a "Vary: Origin" header
in the cache when vary is enabled.
This cannot be considered as a means to manage CORS requests though, it
only processes the Origin header and hashes the presented value without
any form of URI normalization.

This need was expressed by Philipp Hossner in GitHub issue #251.

Co-Authored-by: Philipp Hossner <philipp.hossner@posteo.de>
doc/configuration.txt
include/haproxy/http_ana-t.h
reg-tests/cache/vary.vtc
src/cache.c