]> granicus.if.org Git - apache/commitdiff
Fix problem where mod_cache/mod_disk_cache was setting content_type to
authorBill Stoddard <stoddard@apache.org>
Tue, 28 May 2002 18:04:43 +0000 (18:04 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 28 May 2002 18:04:43 +0000 (18:04 +0000)
text/plain for all cached remote responses.

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

CHANGES
modules/experimental/cache_storage.c
modules/experimental/mod_mem_cache.c

diff --git a/CHANGES b/CHANGES
index 72a5ba2e95f073bd78f90cdb3160e76434f10b4c..42b92549bf35e9ad7c146e62d63610aef16e49a5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 Changes with Apache 2.0.38
+  *) Fix problem where mod_cache/mod_disk_cache was incorrectly
+     stripping the content_type from cached responses.
+     [Bill Stoddard]
 
   *) apachectl passes through any httpd options.  Note: apachectl
      should be used in preference to httpd since it ensures that any
index 4f1df76524b90b04ce5b0619a985af0c07bc7259..d10feea58fed4c124dd07da024d04001346e84ca 100644 (file)
@@ -237,7 +237,6 @@ apr_status_t cache_read_entity_headers(cache_handle_t *h, request_rec *r)
         return rv;
     }
 
-    ap_set_content_type(r, apr_pstrdup(r->pool, info->content_type));
     r->filename = apr_pstrdup(r->pool, info->filename );
 
     return APR_SUCCESS;
index f800b23795fc0fe9dac20e36ce3eacb6666cc142..35ad3dc1b1232e9207f34a5a95c70a8aec76a161 100644 (file)
@@ -648,6 +648,12 @@ static apr_status_t read_headers(cache_handle_t *h, request_rec *r)
     rc = unserialize_table( mobj->notes,
                             mobj->num_notes,
                             r->notes);
+
+    /* Content-Type: header may not be set if content is local since
+     * CACHE_IN runs before header filters....
+     */
+    ap_set_content_type(r, apr_pstrdup(r->pool, h->cache_obj->info.content_type));
+
     return rc;
 }