]> granicus.if.org Git - apache/commitdiff
mod_proxy: Avoid double slash with "ProxyPassReverse / ..." cases
authorGraham Leggett <minfrin@apache.org>
Tue, 2 Oct 2012 21:41:28 +0000 (21:41 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 2 Oct 2012 21:41:28 +0000 (21:41 +0000)
trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1386576
             http://svn.apache.org/viewvc?view=revision&revision=1386578
2.4.x patch: trunk patch works
+1: jim, druggeri, minfrin

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

CHANGES
STATUS
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index 8305acef90bc4b4bb6d1efe73ae34632f7cd27f4..76f591d546665dc95e830f533de4d7a5970d6457 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.4
 
+  *) mod_proxy: When concatting for PPR, avoid cases where we
+     concat ".../" and "/..." to create "...//..." [Jim Jagielski]
+
   *) mod_cache: Wrong content type and character set when
      mod_cache serves stale content because of a proxy error. 
      PR 53539.  [Rainer Jung, Ruediger Pluem]
diff --git a/STATUS b/STATUS
index e8e0d4fe699a29ee8c7cccf3f21b4cca4b9b7033..010b01c83aa70c877d2ac2c94c145b7594af0706 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -89,12 +89,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
   
-   * mod_proxy: Avoid double slash with "ProxyPassReverse / ..." cases
-     trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1386576
-                  http://svn.apache.org/viewvc?view=revision&revision=1386578
-     2.4.x patch: trunk patch works
-     +1: jim, druggeri, minfrin
-
    
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index ffec09eca59a09955413ab61a71a7882b0d7a6b0..4963dcea2901416669b8fbbe3187ad156c993e57 100644 (file)
@@ -894,7 +894,12 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r,
                     }
                 }
                 else if (l1 >= l2 && strncasecmp((*worker)->s->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_is_url(u) ? u : ap_construct_url(r->pool, u, r);
                 }
                 worker++;