httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1610383 - /httpd/httpd/trunk/modules/http/http_filters.c
Date Mon, 14 Jul 2014 10:52:40 GMT
Author: jailletc36
Date: Mon Jul 14 10:52:39 2014
New Revision: 1610383

URL: http://svn.apache.org/r1610383
Log:
Simplify code.

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

Modified:
    httpd/httpd/trunk/modules/http/http_filters.c

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1610383&r1=1610382&r2=1610383&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Jul 14 10:52:39 2014
@@ -560,22 +560,14 @@ static APR_INLINE int check_headers(requ
 
     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;
     }



Mime
View raw message