httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r893871 - in /httpd/httpd/trunk: CHANGES modules/proxy/proxy_util.c
Date Fri, 25 Dec 2009 15:26:50 GMT
Author: niq
Date: Fri Dec 25 15:26:49 2009
New Revision: 893871

URL: http://svn.apache.org/viewvc?rev=893871&view=rev
Log:
Proxy: fix ProxyPassReverse with relative URL
PR 38864

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=893871&r1=893870&r2=893871&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Dec 25 15:26:49 2009
@@ -30,6 +30,9 @@
                     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,

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=893871&r1=893870&r2=893871&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Fri Dec 25 15:26:49 2009
@@ -1117,6 +1117,16 @@
         }
         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);



Mime
View raw message