Mercurial > hg > nginx-quic
changeset 1721:b2829cbf9eb4 stable-0.5
r1585 merge:
allow full URL without URI part: "GET http://host HTTP/1.0"
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Dec 2007 20:42:47 +0000 |
parents | f7c4e833d85a |
children | 3b7262e720c1 |
files | src/http/ngx_http_parse.c |
diffstat | 1 files changed, 21 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -335,18 +335,26 @@ ngx_http_parse_request_line(ngx_http_req break; } + r->host_end = p; + switch (ch) { case ':': - r->host_end = p; state = sw_port; break; case '/': - r->host_end = p; r->uri_start = p; state = sw_after_slash_in_uri; break; + case ' ': + /* + * use single "/" from request line to preserve pointers, + * if request line will be copied to large client buffer + */ + r->uri_start = r->schema_end + 1; + r->uri_end = r->schema_end + 2; + state = sw_http_09; + break; default: - r->host_end = p; return NGX_HTTP_PARSE_INVALID_REQUEST; } break; @@ -362,6 +370,16 @@ ngx_http_parse_request_line(ngx_http_req r->uri_start = p; state = sw_after_slash_in_uri; break; + case ' ': + r->port_end = p; + /* + * use single "/" from request line to preserve pointers, + * if request line will be copied to large client buffer + */ + r->uri_start = r->schema_end + 1; + r->uri_end = r->schema_end + 2; + state = sw_http_09; + break; default: return NGX_HTTP_PARSE_INVALID_REQUEST; }