From: Justin Erenkrantz Date: Tue, 28 Sep 2004 16:17:38 +0000 (+0000) Subject: mod_disk_cache: Correctly store cached content type. X-Git-Tag: 2.1.1~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b3c92051ddc3580b4bf9d7d2c5bf0e53f1ea29e;p=thirdparty%2Fapache%2Fhttpd.git mod_disk_cache: Correctly store cached content type. PR: 30278 Submitted by: R�diger Pl�m Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105315 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 3502013c4cc..c67582a89ab 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_disk_cache: Correctly store cached content type. PR 30278. + [Rüdiger Plüm ] + *) Fix a segfault in the LDAP cache purge. [Jess Holle ] *) mod_rewrite: Handle per-location rules when r->filename is unset. diff --git a/modules/experimental/mod_disk_cache.c b/modules/experimental/mod_disk_cache.c index 6e00c0dfecb..0c9ccd3540b 100644 --- a/modules/experimental/mod_disk_cache.c +++ b/modules/experimental/mod_disk_cache.c @@ -613,16 +613,17 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info headers_out = ap_cache_cacheable_hdrs_out(r->pool, r->headers_out); + if (!apr_table_get(headers_out, "Content-Type") && + r->content_type) { + apr_table_setn(headers_out, "Content-Type", + ap_make_content_type(r, r->content_type)); + } + rv = store_table(dobj->hfd, headers_out); if (rv != APR_SUCCESS) { return rv; } - /* This case only occurs when the content is generated locally */ - if (!apr_table_get(r->headers_out, "Content-Type") && r->content_type) { - apr_table_setn(r->headers_out, "Content-Type", - ap_make_content_type(r, r->content_type)); - } } /* Parse the vary header and dump those fields from the headers_in. */