]> granicus.if.org Git - apache/commitdiff
mod_cache: Wrong content type and character set when mod_cache serves
authorGraham Leggett <minfrin@apache.org>
Tue, 2 Oct 2012 21:25:14 +0000 (21:25 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 2 Oct 2012 21:25:14 +0000 (21:25 +0000)
stale content because of a proxy error. PR 53539. Correction to r1361153.
trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1373447
2.4.x patch: trunk patch works.
+1: rjung, jim, minfrin

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1393191 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/cache/mod_cache.c

diff --git a/CHANGES b/CHANGES
index 424cb585937ed0b6640c5a0465c99e3103285ded..8305acef90bc4b4bb6d1efe73ae34632f7cd27f4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.4
 
+  *) 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]
+
   *) mod_proxy_ajp: Fix crash in packet dump code when logging
      with LogLevel trace7 or trace8.  PR 53730.  [Rainer Jung]
 
diff --git a/STATUS b/STATUS
index d09ec64533aa9f5de15189dec7a52b0bbd7aae0a..e8e0d4fe699a29ee8c7cccf3f21b4cca4b9b7033 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -89,13 +89,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
   
-   * mod_cache: Wrong content type and character set when
-     mod_cache serves stale content because of a proxy error.
-     PR 53539. Correction to r1361153.
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1373447
-     2.4.x patch: trunk patch works.
-     +1: rjung, jim, minfrin
-
    * mod_proxy: Avoid double slash with "ProxyPassReverse / ..." cases
      trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1386576
                   http://svn.apache.org/viewvc?view=revision&revision=1386578
index e75f01d34bf89ec3f50eabb5a1aa9d69a300e438..30b51cc408da2456f4a69c5ac58d8b3b818cbd9e 100644 (file)
@@ -573,6 +573,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;
 
@@ -1655,9 +1659,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)