Commit e90ce9ce authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

mod_disk_cache: Correctly store cached content type.

PR: 30278
Submitted by:	R�diger Pl�m <r.pluem t-online.de>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105315 13f79535-47bb-0310-9956-ffa450edef68
parent b2b2e50a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 <r.pluem t-online.de>]
  *) Fix a segfault in the LDAP cache purge. [Jess Holle <jessh ptc.com>]
  *) mod_rewrite: Handle per-location rules when r->filename is unset.
+6 −5
Original line number Diff line number Diff line
@@ -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. */