]> granicus.if.org Git - apache/commitdiff
Stop destroying headers when passing through the cache filter
authorEdward Lu <elu@apache.org>
Mon, 21 Sep 2015 19:15:47 +0000 (19:15 +0000)
committerEdward Lu <elu@apache.org>
Mon, 21 Sep 2015 19:15:47 +0000 (19:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1704392 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_util.c
modules/cache/mod_cache.c

index 023fc8184319b7bc4527a6a07d5919c9867e2cd9..b29d2eee4a6fac9b6ad88f2cab11d51b1d7d15e9 100644 (file)
@@ -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")) {
index d84448d7f66d56af8de73c6bad8e739fe5720bac..eb70b48eaefb50dadb384822b03b73b033ca5e7b 100644 (file)
@@ -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 */