httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r893955 - in /httpd/httpd/trunk: CHANGES modules/proxy/proxy_util.c
Date Sat, 26 Dec 2009 10:30:52 GMT
Author: niq
Date: Sat Dec 26 10:30:52 2009
New Revision: 893955

URL: http://svn.apache.org/viewvc?rev=893955&view=rev
Log:
Fix r893871 as noted by rpluem, to remove risk of returning a
relative-ised URL, and fix erroneous CHANGES bug attribution.

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=893955&r1=893954&r2=893955&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Dec 26 10:30:52 2009
@@ -30,8 +30,8 @@
                     ScanHTMLTitles, ReadmeName, HeaderName
      PR 48416 [Dmitry Bakshaev <dab18 izhnet.ru>, Nick Kew]
 
-  *) Proxy: Fix ProxyPassReverse with relative URL.
-     PR 38864 [Nick Kew]
+  *) Proxy: Fix ProxyPassReverse with relative URL
+     Derived (slightly erroneously) from PR 38864 [Nick Kew]
 
 Changes with Apache 2.3.4
 

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=893955&r1=893954&r2=893955&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Sat Dec 26 10:30:52 2009
@@ -1116,19 +1116,25 @@
             }
         }
         else {
+            const char *part = url;
             l2 = strlen(real);
             if (real[0] == '/') {
-                const char *part = strstr(url, "://");
+                part = strstr(url, "://");
                 if (part) {
-                    part = strstr(part+3, "/");
+                    part = strchr(part+3, '/');
                     if (part) {
-                        url = part;
-                        l1 = strlen(url);
+                        l1 = strlen(part);
                     }
+                    else {
+                        part = url;
+                    }
+                }
+                else {
+                    part = url;
                 }
             }
-            if (l1 >= l2 && strncasecmp(real, url, l2) == 0) {
-                u = apr_pstrcat(r->pool, ent[i].fake, &url[l2], NULL);
+            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);
             }
         }



Mime
View raw message