From: Bill Stoddard Date: Tue, 28 May 2002 18:04:43 +0000 (+0000) Subject: Fix problem where mod_cache/mod_disk_cache was setting content_type to X-Git-Tag: 2.0.37~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45e259b51463f270954fcb7d589320aaa8365206;p=apache Fix problem where mod_cache/mod_disk_cache was setting content_type to 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 --- diff --git a/CHANGES b/CHANGES index 72a5ba2e95..42b92549bf 100644 --- 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 diff --git a/modules/experimental/cache_storage.c b/modules/experimental/cache_storage.c index 4f1df76524..d10feea58f 100644 --- a/modules/experimental/cache_storage.c +++ b/modules/experimental/cache_storage.c @@ -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; diff --git a/modules/experimental/mod_mem_cache.c b/modules/experimental/mod_mem_cache.c index f800b23795..35ad3dc1b1 100644 --- a/modules/experimental/mod_mem_cache.c +++ b/modules/experimental/mod_mem_cache.c @@ -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; }