From: Stefan Fritsch Date: Sun, 23 Oct 2011 22:07:50 +0000 (+0000) Subject: Fix 3xx responses with local URLs as ErrorDocument X-Git-Tag: 2.3.15~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4db71797ea519098646358ba3b2c6a97f2d6d4fc;p=apache Fix 3xx responses with local URLs as ErrorDocument git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1187985 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f5fe1ca59a..6c015c0db9 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,9 @@ Changes with Apache 2.3.15 PR 51714. [Stefan Fritsch, Jim Jagielski, Ruediger Pluem, Eric Covener, ] + *) http: Add missing Location header if local URL-path is used as + ErrorDocument for 30x. [Stefan Fritsch] + *) mod_buffer: Make sure we step down for subrequests, but not for internal redirects triggered by mod_rewrite. [Graham Leggett] diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 0408db193a..0a25333ee4 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -459,6 +459,11 @@ static request_rec *internal_internal_redirect(const char *new_uri, new->headers_in = r->headers_in; new->headers_out = apr_table_make(r->pool, 12); + if (ap_is_HTTP_REDIRECT(new->status)) { + const char *location = apr_table_get(r->headers_out, "Location"); + if (location) + apr_table_setn(new->headers_out, "Location", location); + } new->err_headers_out = r->err_headers_out; new->subprocess_env = rename_original_env(r->pool, r->subprocess_env); new->notes = apr_table_make(r->pool, 5);