From: William A. Rowe Jr Date: Mon, 22 Apr 2013 15:55:10 +0000 (+0000) Subject: mod_proxy_balancer: Correct doubled-slash ProxyPassReverse X-Git-Tag: 2.2.25~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ea4a269365f51799d3a4a0de9cb11de817b9eec;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy_balancer: Correct doubled-slash ProxyPassReverse 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 --- diff --git a/STATUS b/STATUS index a9a1d05d905..a46543921b6 100644 --- 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) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index c64b0db5b1a..62e8acd23e8 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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++;