]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport: r1610383
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 9 Nov 2016 14:23:00 +0000 (14:23 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 9 Nov 2016 14:23:00 +0000 (14:23 +0000)
Submitted by: jailletc36
Simplify code.

Cases where 'loc' doesn't have any ':' or is  starting with ':' are already
handled by 'ap_is_url()'
Calling 'apr_isascii()' seems useless.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x-merge-http-strict@1768969 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_filters.c

index aa95829a22db0d01d6145f2c9572d4c864b91787..8f35b5751c93133c3de2e740354237330166c2c4 100644 (file)
@@ -718,22 +718,14 @@ static APR_INLINE int check_headers(request_rec *r)
 
     if ((loc = apr_table_get(r->headers_out, "Location")) != NULL) {
         const char *scheme_end = ap_strchr_c(loc, ':');
-        const char *s = loc;
 
         /*
          * Check that the URI has a valid scheme and is absolute
          * XXX Should we do a full uri parse here?
          */
-        if (scheme_end == NULL || scheme_end == loc)
+        if (!ap_is_url(loc))
             goto bad;
 
-        do {
-            if ((!apr_isalnum(*s) && *s != '.' && *s != '+' && *s != '-')
-                || !apr_isascii(*s) ) {
-                goto bad;
-            }
-        } while (++s < scheme_end);
-
         if (scheme_end[1] != '/' || scheme_end[2] != '/')
             goto bad;
     }