]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_balancer: Correct doubled-slash ProxyPassReverse
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 22 Apr 2013 15:55:10 +0000 (15:55 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 22 Apr 2013 15:55:10 +0000 (15:55 +0000)
PR:           51489 51982
Backports:    r1386576, r1386578
Submitted by: jimjag
Reviewed by:  wrowe, druggeri, humbedooh

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1470592 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/proxy_util.c

diff --git a/STATUS b/STATUS
index a9a1d05d905cdbc0d75243734f71dcf51137dfe4..a46543921b64e4e6a14a048472a38e40cd9dbb59 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -196,12 +196,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
     2.2.x patch: http://people.apache.org/~druggeri/patches/httpd-2.2.x-failontimeout.patch
     +1: druggeri
 
-  * mod_proxy_balancer: Correct doubled-slash ProxyPassReverse
-    PR: 51489 51982
-    Backport of r1386576, r1386578 attached to 51982 
-      https://issues.apache.org/bugzilla/attachment.cgi?id=30179&action=diff
-    +1: wrowe, druggeri, humbedooh
-
   * mod_ssl: Catch missing, mismatched or encrypted client cert/key pairs
     with SSLProxyMachineCertificateFile/Path directives. PR 52212, PR 54698.
     (check at startup, to prevent segfaults at proxy request time)
index c64b0db5b1ad7c3604a96a604184273ae9f15cf8..62e8acd23e8020925648195a32e34cd5a0427aeb 100644 (file)
@@ -1118,7 +1118,12 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r,
                     }
                 }
                 else if (l1 >= l2 && strncasecmp(worker->name, url, l2) == 0) {
-                    u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL);
+                    /* edge case where fake is just "/"... avoid double slash */
+                    if ((ent[i].fake[0] == '/') && (ent[i].fake[1] == 0) && (url[l2] == '/')) {
+                        u = apr_pstrdup(r->pool, &url[l2]);
+                    } else {
+                        u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL);
+                    }
                     return ap_construct_url(r->pool, u, r);
                 }
                 worker++;