]> granicus.if.org Git - apache/commitdiff
Proxy: fix ProxyPassReverse with relative URL
authorNick Kew <niq@apache.org>
Fri, 25 Dec 2009 15:26:49 +0000 (15:26 +0000)
committerNick Kew <niq@apache.org>
Fri, 25 Dec 2009 15:26:49 +0000 (15:26 +0000)
PR 38864

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@893871 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index 59942cda2149971ab9f9a0bf25c41b3e066876a5..4e35251412f8ab105cb2fc4e7fd263474cb04cd5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -30,6 +30,9 @@ Changes with Apache 2.3.5
                     ScanHTMLTitles, ReadmeName, HeaderName
      PR 48416 [Dmitry Bakshaev <dab18 izhnet.ru>, Nick Kew]
 
+  *) Proxy: Fix ProxyPassReverse with relative URL.
+     PR 38864 [Nick Kew]
+
 Changes with Apache 2.3.4
 
   *) Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
index 64e0cfd7ea66f1c9467c8090843a4aa52a9bb767..d310d73686456c279d4f7f21dbe234e7592151de 100644 (file)
@@ -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);