]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Wrong content type and character set when
authorRainer Jung <rjung@apache.org>
Wed, 15 Aug 2012 15:06:24 +0000 (15:06 +0000)
committerRainer Jung <rjung@apache.org>
Wed, 15 Aug 2012 15:06:24 +0000 (15:06 +0000)
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

CHANGES
modules/cache/mod_cache.c

diff --git a/CHANGES b/CHANGES
index effed03b2a53511feeded7dcd1edfa0cec18d75f..4db0da65db186fdf89506ad7a93d78ba31809227 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_cache: Wrong content type and character set when
+     mod_cache serves stale content because of a proxy error. 
+     PR 53539.  [Rainer Jung, Ruediger Pluem]
+
   *) core: Be less strict when checking whether Content-Type is set to 
      "application/x-www-form-urlencoded" when parsing POST data, 
      or we risk losing data with an appended charset. PR 53698
index d402fb576d41c609581e276b9c9f8761d7e51b17..c5c4d3b1fe7138dfba98ea90da36a59e6a5da355 100644 (file)
@@ -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)