]> granicus.if.org Git - apache/commitdiff
* Keep the Content-Type for successfully revalidated
authorRuediger Pluem <rpluem@apache.org>
Tue, 30 May 2006 20:48:09 +0000 (20:48 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 30 May 2006 20:48:09 +0000 (20:48 +0000)
  cached objects, by unsetting possible Content-Type headers in
  r->headers_out and r->err_headers_out as they may be different to what
  we have received from the cache.
  Actually they are not needed as r->content_type set by
  ap_set_content_type a few lines above will be used in the store_headers
  functions of the storage providers as a fallback and the HTTP_HEADER filter
  does overwrite the Content-Type header with r->content_type anyway.

PR: 39647

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@410370 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/cache_storage.c

diff --git a/CHANGES b/CHANGES
index d5b66a3b84c77fa623da5a6da84fc10297ffb7f4..e8e4843f6ad2e7dedf1c439665b3395d60551c76 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_cache: Do not overwrite the Content-Type in the cache, for
+     successfully revalidated cached objects. PR 39647. [Ruediger Pluem]
+
   *) mod_disk_cache: Delete temporary files if they cannot be renamed to their
      final name. [Davi Arnaut <davi haxent.com.br>]
 
index bac7aa21e614965c2783c48a5e78f5aeb5483479..6e0a56228f3bd79a75897c05a06171869e6497c0 100644 (file)
@@ -118,6 +118,17 @@ CACHE_DECLARE(void) ap_cache_accept_headers(cache_handle_t *h, request_rec *r,
     if (v) {
         ap_set_content_type(r, v);
         apr_table_unset(h->resp_hdrs, "Content-Type");
+        /*
+         * Also unset possible Content-Type headers in r->headers_out and
+         * r->err_headers_out as they may be different to what we have received
+         * from the cache.
+         * Actually they are not needed as r->content_type set by
+         * ap_set_content_type above will be used in the store_headers functions
+         * of the storage providers as a fallback and the HTTP_HEADER filter
+         * does overwrite the Content-Type header with r->content_type anyway.
+         */
+        apr_table_unset(r->headers_out, "Content-Type");
+        apr_table_unset(r->err_headers_out, "Content-Type");
     }
 
     /* If the cache gave us a Last-Modified header, we can't just