From: Nick Kew Date: Fri, 29 Jul 2011 15:40:19 +0000 (+0000) Subject: mod_proxy: enable absolute URLs to be rewritten with ProxyPassReverse, X-Git-Tag: 2.3.14^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9da1f5744311c90fc23bbf5bf323a62d1e0f8d1a;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy: enable absolute URLs to be rewritten with ProxyPassReverse, e.g. to reverse proxy "Location: https://other-internal-server/login" with ProxyPassReverse https://public-address/ https://other-internal-server/ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1152273 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 7844bb79e98..371d18d0571 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.3.14 + *) mod_proxy: enable absolute URLs to be rewritten with ProxyPassReverse, + e.g. to reverse proxy "Location: https://other-internal-server/login" + [Nick Kew] + *) prefork, worker, event: Make sure crashes are logged to the error log if httpd has already detached from the console. [Stefan Fritsch] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index d78b5f6a910..25fd26c82a5 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1144,12 +1144,12 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, && strncmp(urlpart, url + l2, l3) == 0) { u = apr_pstrcat(r->pool, ent[i].fake, &url[l2 + l3], NULL); - return ap_construct_url(r->pool, u, r); + return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r); } } else if (l1 >= l2 && strncasecmp((*worker)->s->name, url, l2) == 0) { u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL); - return ap_construct_url(r->pool, u, r); + return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r); } worker++; } @@ -1174,7 +1174,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, } if (l1 >= l2 && strncasecmp(real, part, l2) == 0) { u = apr_pstrcat(r->pool, ent[i].fake, &part[l2], NULL); - return ap_construct_url(r->pool, u, r); + return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r); } } }