httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1770786 - /httpd/httpd/trunk/modules/http/http_filters.c
Date Tue, 22 Nov 2016 01:53:40 GMT
Author: covener
Date: Tue Nov 22 01:53:40 2016
New Revision: 1770786

URL: http://svn.apache.org/viewvc?rev=1770786&view=rev
Log:
remove Location: header checks for absolute URL

https://tools.ietf.org/html/rfc7231#section-7.1.2

   The "Location" header field is used in some responses to refer to a
   specific resource in relation to the response.  The type of
   relationship is defined by the combination of request method and
   status code semantics.

     Location = URI-reference

   The field value consists of a single URI-reference.  When it has the
   form of a relative reference ([RFC3986], Section 4.2), the final
   value is computed by resolving it against the effective request URI
   ([RFC3986], Section 5).


There is even an example with no scheme:

     Location: /People.html#tim


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=1770786&r1=1770785&r2=1770786&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Tue Nov 22 01:53:40 2016
@@ -696,27 +696,7 @@ static APR_INLINE int check_headers(requ
     if (!apr_table_do(check_header, &ctx, r->headers_out, NULL))
         return 0; /* problem has been logged by check_header() */
 
-    if ((loc = apr_table_get(r->headers_out, "Location")) != NULL) {
-        const char *scheme_end = ap_strchr_c(loc, ':');
-
-        /*
-         * Check that the URI has a valid scheme and is absolute
-         * XXX Should we do a full uri parse here?
-         */
-        if (!ap_is_url(loc))
-            goto bad;
-
-        if (scheme_end[1] != '/' || scheme_end[2] != '/')
-            goto bad;
-    }
-
     return 1;
-
-bad:
-    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02431)
-                  "Bad Location header in response: '%s', aborting request",
-                  loc);
-    return 0;
 }
 
 typedef struct header_struct {



Mime
View raw message