From: Nick Kew Date: Fri, 25 Dec 2009 15:26:49 +0000 (+0000) Subject: Proxy: fix ProxyPassReverse with relative URL X-Git-Tag: 2.3.5~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71b01f9b824c129487a2ec65130fe9e20880fa09;p=apache Proxy: fix ProxyPassReverse with relative URL PR 38864 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893871 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 59942cda21..4e35251412 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,9 @@ Changes with Apache 2.3.5 ScanHTMLTitles, ReadmeName, HeaderName PR 48416 [Dmitry Bakshaev , Nick Kew] + *) Proxy: Fix ProxyPassReverse with relative URL. + PR 38864 [Nick Kew] + Changes with Apache 2.3.4 *) Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex, diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 64e0cfd7ea..d310d73686 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1117,6 +1117,16 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, } else { l2 = strlen(real); + if (real[0] == '/') { + const char *part = strstr(url, "://"); + if (part) { + part = strstr(part+3, "/"); + if (part) { + url = part; + l1 = strlen(url); + } + } + } if (l1 >= l2 && strncasecmp(real, url, l2) == 0) { u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL); return ap_construct_url(r->pool, u, r);