From 89b823e1447fe6153052d43e2abfc3f60614110a Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Tue, 28 May 2002 18:04:43 +0000 Subject: [PATCH] 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 --- CHANGES | 3 +++ modules/experimental/cache_storage.c | 1 - modules/experimental/mod_mem_cache.c | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.40.0