aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2020-12-15 16:55:43 +0000
committerSergey Kandaurov <pluknet@nginx.com>2020-12-15 16:55:43 +0000
commit1a3bf7d59399d15adde8b22a578f40758764d262 (patch)
tree0a57f72d74f0351bb870d24f545ff8ec5bf264ed /src/http/ngx_http_parse.c
parent240f8a918ed09e67570020261b1693907e5b64c0 (diff)
parent402f4cda0c389242a587eff7bb55959663504c8b (diff)
downloadnginx-1a3bf7d59399d15adde8b22a578f40758764d262.tar.gz
nginx-1a3bf7d59399d15adde8b22a578f40758764d262.zip
Merged with the default branch.
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index f8ec03c50..7b5cd30cd 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -381,6 +381,12 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
r->uri_start = p;
state = sw_after_slash_in_uri;
break;
+ case '?':
+ r->uri_start = p;
+ r->args_start = p + 1;
+ r->empty_path_in_uri = 1;
+ state = sw_uri;
+ break;
case ' ':
/*
* use single "/" from request line to preserve pointers,
@@ -447,6 +453,13 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
r->uri_start = p;
state = sw_after_slash_in_uri;
break;
+ case '?':
+ r->port_end = p;
+ r->uri_start = p;
+ r->args_start = p + 1;
+ r->empty_path_in_uri = 1;
+ state = sw_uri;
+ break;
case ' ':
r->port_end = p;
/*
@@ -1289,6 +1302,10 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r, ngx_uint_t merge_slashes)
r->uri_ext = NULL;
r->args_start = NULL;
+ if (r->empty_path_in_uri) {
+ *u++ = '/';
+ }
+
ch = *p++;
while (p <= r->uri_end) {