httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r738268 - /httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
Date Tue, 27 Jan 2009 22:08:23 GMT
Author: rpluem
Date: Tue Jan 27 22:08:23 2009
New Revision: 738268

URL: http://svn.apache.org/viewvc?rev=738268&view=rev
Log:
* Correctly construct base href url in the reverse proxy case.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c?rev=738268&r1=738267&r2=738268&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Tue Jan 27 22:08:23 2009
@@ -316,15 +316,24 @@
         char *wildcard = NULL;
         const char *escpath;
 
-        /* Save "scheme://site" prefix without password */
-        site = apr_uri_unparse(p, &f->r->parsed_uri, APR_URI_UNP_OMITPASSWORD |
APR_URI_UNP_OMITPATHINFO);
         /*
-         * In the reverse proxy case we usually have no site. So contruct
-         * one.
+         * In the reverse proxy case we need to construct our site string
+         * via ap_construct_url. For non anonymous sites apr_uri_unparse would
+         * only supply us with 'username@' which leads to the construction of
+         * an invalid base href later on. Losing the username part of the URL
+         * is no problem in the reverse proxy case as the browser sents the
+         * credentials anyway once entered.
          */
-        if ((*site == '\0') && (r->proxyreq == PROXYREQ_REVERSE)) {
+        if (r->proxyreq == PROXYREQ_REVERSE) {
             site = ap_construct_url(p, "", r);
         }
+        else {
+            /* Save "scheme://site" prefix without password */
+            site = apr_uri_unparse(p, &f->r->parsed_uri,
+                                   APR_URI_UNP_OMITPASSWORD |
+                                   APR_URI_UNP_OMITPATHINFO);
+        }
+
         /* ... and path without query args */
         path = apr_uri_unparse(p, &f->r->parsed_uri, APR_URI_UNP_OMITSITEPART |
APR_URI_UNP_OMITQUERY);
 



Mime
View raw message