]> granicus.if.org Git - apache/commitdiff
mod_proxy: enable absolute URLs to be rewritten with ProxyPassReverse,
authorNick Kew <niq@apache.org>
Fri, 29 Jul 2011 15:40:19 +0000 (15:40 +0000)
committerNick Kew <niq@apache.org>
Fri, 29 Jul 2011 15:40:19 +0000 (15:40 +0000)
e.g. to reverse proxy "Location: https://other-internal-server/login" with
ProxyPassReverse https://public-address/ https://other-internal-server/

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

CHANGES
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index 7844bb79e9848bdaf2ab837724599e116d49e0e5..371d18d0571da3c47b556ff8b0fd7638388fa6df 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.14
 
+  *) mod_proxy: enable absolute URLs to be rewritten with ProxyPassReverse,
+     e.g. to reverse proxy "Location: https://other-internal-server/login"
+     [Nick Kew]
+
   *) prefork, worker, event: Make sure crashes are logged to the error log if
      httpd has already detached from the console. [Stefan Fritsch]
 
index d78b5f6a91079ca5d7e791ddbaa96f0c1b9ef518..25fd26c82a5b8c3dd8538091231c9827adc8e63b 100644 (file)
@@ -1144,12 +1144,12 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r,
                             && strncmp(urlpart, url + l2, l3) == 0) {
                         u = apr_pstrcat(r->pool, ent[i].fake, &url[l2 + l3],
                                         NULL);
-                        return ap_construct_url(r->pool, u, r);
+                        return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r);
                     }
                 }
                 else if (l1 >= l2 && strncasecmp((*worker)->s->name, url, l2) == 0) {
                     u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL);
-                    return ap_construct_url(r->pool, u, r);
+                    return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r);
                 }
                 worker++;
             }
@@ -1174,7 +1174,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r,
             }
             if (l1 >= l2 && strncasecmp(real, part, l2) == 0) {
                 u = apr_pstrcat(r->pool, ent[i].fake, &part[l2], NULL);
-                return ap_construct_url(r->pool, u, r);
+                return ap_is_url(u) ? u : ap_construct_url(r->pool, u, r);
             }
         }
     }