dgaudet 98/03/04 02:50:33
Modified: src/modules/proxy mod_proxy.c Log: Revert a parsed uri change which I think was Martin's -- in proxy_fixup the comparisons are done against the url as stored in r->filename... it's kind of lame, but this is just how the proxy works. So for example, if you're using ProxyPass the url stored in r->filename won't match what was passed to parse_uri() ... so r->parsed_uri isn't useful. I reverted to what was before, plus a few performance tweaks I couldn't resist. Revision Changes Path 1.44 +10 -10 apache-1.3/src/modules/proxy/mod_proxy.c Index: mod_proxy.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- mod_proxy.c 1998/03/04 08:54:32 1.43 +++ mod_proxy.c 1998/03/04 10:50:30 1.44 @@ -170,24 +170,24 @@ */ static int proxy_fixup(request_rec *r) { - char *url; + char *url, *p; if (!r->proxyreq || strncmp(r->filename, "proxy:", 6) != 0) return DECLINED; url = &r->filename[6]; - if (!r->parsed_uri.scheme) { - return DECLINED; - } - /* canonicalise each specific scheme */ - if (strcasecmp(r->parsed_uri.scheme, "http") == 0) - return proxy_http_canon(r, url + 5, "http", default_port_for_scheme(r->parsed_uri.scheme)); - else if (strcasecmp(r->parsed_uri.scheme, "ftp") == 0) + if (strncasecmp(url, "http:", 5) == 0) + return proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT); + else if (strncasecmp(url, "ftp:", 4) == 0) return proxy_ftp_canon(r, url + 4); - else - return OK; /* otherwise; we've done the best we can */ + + p = strchr(url, ':'); + if (p == NULL || p == url) + return BAD_REQUEST; + + return OK; /* otherwise; we've done the best we can */ } static void proxy_init(server_rec *r, pool *p)