]> granicus.if.org Git - apache/commitdiff
mod_cache does no longer send Content-Type header
authorRainer Jung <rjung@apache.org>
Sun, 27 Jan 2013 16:32:00 +0000 (16:32 +0000)
committerRainer Jung <rjung@apache.org>
Sun, 27 Jan 2013 16:32:00 +0000 (16:32 +0000)
for fresh content.

Followup to trunk r1361153+r1373447 resp. 2.4.x
r1373115+r1393191 (PR 53539, wrong Content-Type
for stale content).

Backport of r1439083 from trunk.

No CHANGES needed, because problem was introduced
after 2.4.3.

Submitted by: rjung
Backported by: rjung
Reviewed by: rjung, covener, minfrin

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

STATUS
modules/cache/mod_cache.c

diff --git a/STATUS b/STATUS
index 492a09f1891ece7a5ec98681bb02d67400994189..1014c51985553282538b2a1e269b302a18304507 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -100,7 +100,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
                http://mail-archives.apache.org/mod_mbox/httpd-dev/201301.mbox/%3C20130103112044.GA19653%40redhat.com%3E
         kbrand: configure option added in r1429228
 
-
    * mod_status: Add useful mod_status info... try to determine last time
      a specific vhost was accessed/used.
      trunk patch: https://svn.apache.org/viewvc?view=revision&revision=1417529
@@ -137,19 +136,12 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
     2.4.x patch: http://people.apache.org/~jailletc36/backport4.patch
     +1: jailletc36, rjung, covener
 
-
   * Speed-up 'ap_fputs'. This change is just the inline version of what is remaining
     in apr_brigade_puts() after http://svn.apache.org/viewvc?view=revision&revision=1402870
     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1409437
     2.4.x patch: trunk patches works
     +1: jailletc36, rjung, covener
 
-  * mod_cache: Cache does no longer send Content-Type header for fresh content.
-    Followup to r1361153+r1373447 (PR 53539, wrong Content-Type for stale content).
-    trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1439083
-    2.4.x patch: trunk patches works
-    +1: rjung, covener, minfrin
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 30b51cc408da2456f4a69c5ac58d8b3b818cbd9e..4f2d3e0468591446fbba87588e28b4f5382e47fa 100644 (file)
@@ -573,9 +573,12 @@ 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 content type of cached response if available */
+            /* Needed especially when stale content gets served. */
+            const char *ct = apr_table_get(cache->handle->resp_hdrs, "Content-Type");
+            if (ct) {
+                ap_set_content_type(r, ct);
+            }
 
             /* restore status of cached response */
             r->status = cache->handle->cache_obj->info.status;