diff --git a/CHANGES b/CHANGES index 34e6f4f2a4..de4b6ae4e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.36 + *) Fix subreqs with non-defined Content-Types being served improperly. + [Justin Erenkrantz] + *) Merge in latest GNU config.guess and config.sub files. PR 7818. [Justin Erenkrantz] diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 6b38f3ed21..6c87ae867a 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1297,7 +1297,10 @@ static void fixup_vary(request_rec *r) AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct) { - if (!r->content_type || strcmp(r->content_type, ct)) { + if (!ct) { + r->content_type = NULL; + } + else if (!r->content_type || strcmp(r->content_type, ct)) { r->content_type = ct; /* Insert filters requested by the AddOutputFiltersByType diff --git a/modules/http/http_request.c b/modules/http/http_request.c index ae52cd95d7..88e1434511 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -422,9 +422,7 @@ AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r) r->args = rr->args; r->finfo = rr->finfo; r->handler = rr->handler; - if (rr->content_type) { - ap_set_content_type(r, rr->content_type); - } + ap_set_content_type(r, rr->content_type); r->content_encoding = rr->content_encoding; r->content_languages = rr->content_languages; r->per_dir_config = rr->per_dir_config;