]> granicus.if.org Git - apache/commitdiff
mod_cache: Ensure that r->content_type is set when serving stale
authorGraham Leggett <minfrin@apache.org>
Mon, 6 Jun 2011 22:44:31 +0000 (22:44 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 6 Jun 2011 22:44:31 +0000 (22:44 +0000)
content in response to a failed attempt to revalidate.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132816 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/mod_cache.c

index 83abb634cbe558ba37022672173d35d744480bdd..40daced9eb29eaf22cc0f997a60d9ae66a24a3bb 100644 (file)
@@ -843,6 +843,9 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
 
             r->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)