From: Ruediger Pluem Date: Tue, 27 Jan 2009 22:08:23 +0000 (+0000) Subject: * Correctly construct base href url in the reverse proxy case. X-Git-Tag: 2.3.2~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7621dff9975fd1659b0ca66aab7cb420b5aefdb5;p=apache * Correctly construct base href url in the reverse proxy case. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@738268 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index d92b0ca7a2..1058bfe25c 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -316,15 +316,24 @@ static apr_status_t proxy_send_dir_filter(ap_filter_t *f, 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);