summaryrefslogtreecommitdiffstats
path: root/modules/cache
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2011-11-12 22:24:47 +0100
committerGraham Leggett <minfrin@apache.org>2011-11-12 22:24:47 +0100
commitd4780b88c95d8b1c2d8724a1491ed25eb4645c2e (patch)
treea43aa5a55493e4e1103d9c58198d196f3c2cb868 /modules/cache
parentSet --enable-load-all-modules implicitely in (diff)
downloadapache2-d4780b88c95d8b1c2d8724a1491ed25eb4645c2e.tar.xz
apache2-d4780b88c95d8b1c2d8724a1491ed25eb4645c2e.zip
mod_cache: Make sure we merge headers correctly when we handle a non
cacheable conditional response. PR52120. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201331 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cache')
-rw-r--r--modules/cache/mod_cache.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c
index b97a21c285..af7be13523 100644
--- a/modules/cache/mod_cache.c
+++ b/modules/cache/mod_cache.c
@@ -1081,6 +1081,20 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
APR_BRIGADE_INSERT_TAIL(bb, bkt);
}
else {
+ /* RFC 2616 10.3.5 states that entity headers are not supposed
+ * to be in the 304 response. Therefore, we need to combine the
+ * response headers with the cached headers *before* we update
+ * the cached headers.
+ *
+ * However, before doing that, we need to first merge in
+ * err_headers_out and we also need to strip any hop-by-hop
+ * headers that might have snuck in.
+ */
+ r->headers_out = ap_cache_cacheable_headers_out(r);
+
+ /* Merge in our cached headers. However, keep any updated values. */
+ cache_accept_headers(cache->handle, r, 1);
+
cache->provider->recall_body(cache->handle, r->pool, bb);
bkt = apr_bucket_eos_create(bb->bucket_alloc);