]> granicus.if.org Git - apache/commitdiff
Simplify code.
authorChristophe Jaillet <jailletc36@apache.org>
Mon, 14 Jul 2014 10:52:39 +0000 (10:52 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Mon, 14 Jul 2014 10:52:39 +0000 (10:52 +0000)
Cases where 'loc' doesn't have any ':' or is  starting with ':' are already handled by 'ap_ir_url()'
Calling 'apr_isascii()' seems useless.

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

modules/http/http_filters.c

index 11d5cf8f774632b0d09208c62bb1d3197f32c837..d2c618dd62129775741689d9007c014554192523 100644 (file)
@@ -560,22 +560,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;
     }