]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_http: follow up to r1886141, axe overlong scheme check.
authorYann Ylavic <ylavic@apache.org>
Wed, 3 Feb 2021 11:29:10 +0000 (11:29 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 3 Feb 2021 11:29:10 +0000 (11:29 +0000)
Since mod_proxy can see CONNECT URIs, "hostname:port" versus "scheme:"
is hardly distinguishable (we don't want to limit the length of hostnames),
and we don't allocate the scheme anymore while parsing, let's simply decline
unrecognized schemes (overlong or not) and be caught by the no-handler case
if there really is no proxy handler interested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1886151 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_http.c

index 637fc8760908a96d3f439d2c89f12bffc929e62b..d32b14e3f0e1872376b3bc98b85f45edf0577547 100644 (file)
@@ -1907,11 +1907,6 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker,
                       "HTTP: declining URL %s", url);
         return DECLINED; /* only interested in HTTP, WS or FTP via proxy */
     }
-    if (!scheme && (u = strchr(url, ':')) && (u - url) > 14) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10262)
-                      "overlong proxy URL scheme in %s", url);
-        return HTTP_BAD_REQUEST;
-    }
     if (is_ssl && !ap_proxy_ssl_enable(NULL)) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01112)
                       "HTTP: declining URL %s (mod_ssl not configured?)", url);