comparison src/http/ngx_http_request.h @ 8251:8989fbd2f89a

Fixed parsing of absolute URIs with empty path (ticket #2079). When the request line contains request-target in the absolute-URI form, it can contain path-empty instead of a single slash (see RFC 7230, RFC 3986). Previously, the ngx_http_parse_request_line() function only accepted empty path when there was no query string. With this change, non-empty query is also correctly handled. That is, request line "GET http://example.com?foo HTTP/1.1" is accepted and results in $uri "/" and $args "foo". Note that $request_uri remains "?foo", similarly to how spaces in URIs are handled. Providing "/?foo", similarly to how "/" is provided for "GET http://example.com HTTP/1.1", requires allocation.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 10 Dec 2020 20:09:30 +0300
parents 9606d93aa586
children f61d347158d0 63c66b7cc07c
comparison
equal deleted inserted replaced
8250:7efae6b4cfb0 8251:8989fbd2f89a
467 /* URI with "+" */ 467 /* URI with "+" */
468 unsigned plus_in_uri:1; 468 unsigned plus_in_uri:1;
469 469
470 /* URI with " " */ 470 /* URI with " " */
471 unsigned space_in_uri:1; 471 unsigned space_in_uri:1;
472
473 /* URI with empty path */
474 unsigned empty_path_in_uri:1;
472 475
473 unsigned invalid_header:1; 476 unsigned invalid_header:1;
474 477
475 unsigned add_uri_to_alias:1; 478 unsigned add_uri_to_alias:1;
476 unsigned valid_location:1; 479 unsigned valid_location:1;