summaryrefslogtreecommitdiffstats
path: root/modules/cache/mod_cache.c
diff options
context:
space:
mode:
authorRainer Jung <rjung@apache.org>2012-08-15 17:06:24 +0200
committerRainer Jung <rjung@apache.org>2012-08-15 17:06:24 +0200
commitd247f6bafbbe8bf659115ae53bd95920badb088a (patch)
tree2566d08580f798707001a6a394f3df71fa4b389a /modules/cache/mod_cache.c
parentFix ported to 2.4. (diff)
downloadapache2-d247f6bafbbe8bf659115ae53bd95920badb088a.tar.xz
apache2-d247f6bafbbe8bf659115ae53bd95920badb088a.zip
Wrong content type and character set when
mod_cache serves stale content because of a proxy error. PR 53539. Correction to r1361153. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1373447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cache/mod_cache.c')
-rw-r--r--modules/cache/mod_cache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c
index d402fb576d..c5c4d3b1fe 100644
--- a/modules/cache/mod_cache.c
+++ b/modules/cache/mod_cache.c
@@ -604,6 +604,10 @@ static apr_status_t cache_out_filter(ap_filter_t *f, apr_bucket_brigade *in)
apr_bucket_brigade *bb = apr_brigade_create(r->pool,
r->connection->bucket_alloc);
+ /* restore content type of cached response */
+ ap_set_content_type(r, apr_table_get(cache->handle->resp_hdrs,
+ "Content-Type"));
+
/* restore status of cached response */
r->status = cache->handle->cache_obj->info.status;
@@ -1686,9 +1690,6 @@ static void cache_insert_error_filter(request_rec *r)
r->err_headers_out = cache->stale_handle->resp_hdrs;
- ap_set_content_type(r, apr_table_get(
- cache->stale_handle->resp_hdrs, "Content-Type"));
-
/* add a revalidation warning */
warn_head = apr_table_get(r->err_headers_out, "Warning");
if ((warn_head == NULL) || ((warn_head != NULL)