From 938a1c747065c3241ff9b04840d540485ab1bc3f Mon Sep 17 00:00:00 2001 From: Edward Lu Date: Mon, 21 Sep 2015 19:15:47 +0000 Subject: [PATCH] Stop destroying headers when passing through the cache filter git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1704392 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cache/cache_util.c | 1 - modules/cache/mod_cache.c | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index 023fc81843..b29d2eee4a 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -1272,7 +1272,6 @@ apr_table_t *cache_merge_headers_out(request_rec *r) headers_out = apr_table_overlay(r->pool, r->headers_out, r->err_headers_out); - apr_table_clear(r->err_headers_out); if (r->content_type && !apr_table_get(headers_out, "Content-Type")) { diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index d84448d7f6..eb70b48eae 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -122,12 +122,10 @@ static int cache_quick_handler(request_rec *r, int lookup) return DECLINED; } - /* find certain cache controlling headers */ + /* Since we're in the quick handler, authorization will not have been + * processed through normal channels yet. Just decline the request if + * it's trying to authorize. */ auth = apr_table_get(r->headers_in, "Authorization"); - - /* First things first - does the request allow us to return - * cached information at all? If not, just decline the request. - */ if (auth) { return DECLINED; } @@ -1462,6 +1460,7 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) * forward all of them to the client, including non-cacheable ones). */ r->headers_out = cache_merge_headers_out(r); + apr_table_clear(r->err_headers_out); /* Merge in our cached headers. However, keep any updated values. */ /* take output, overlay on top of cached */ -- 2.40.0