aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r--src/http/ngx_http_parse.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index 426aa8a0e..24b7f8c80 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -337,13 +337,13 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
r->quoted_uri = 1;
state = sw_uri;
break;
- case '+':
- r->plus_in_uri = 1;
- break;
case '?':
r->args_start = p + 1;
state = sw_uri;
break;
+ case '+':
+ r->plus_in_uri = 1;
+ break;
case '\0':
r->zero_in_uri = 1;
break;
@@ -366,9 +366,6 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
r->uri_end = p;
r->http_minor = 9;
goto done;
- case '+':
- r->plus_in_uri = 1;
- break;
case '\0':
r->zero_in_uri = 1;
break;
@@ -828,6 +825,8 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
r->uri_ext = u + 1;
*u++ = ch;
break;
+ case '+':
+ r->plus_in_uri = 1;
default:
*u++ = ch;
break;
@@ -853,6 +852,8 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
case '?':
r->args_start = p;
goto done;
+ case '+':
+ r->plus_in_uri = 1;
default:
state = sw_usual;
*u++ = ch;
@@ -881,6 +882,8 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
case '?':
r->args_start = p;
goto done;
+ case '+':
+ r->plus_in_uri = 1;
default:
state = sw_usual;
*u++ = ch;
@@ -917,6 +920,8 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
*u++ = ch;
break;
#endif
+ case '+':
+ r->plus_in_uri = 1;
default:
state = sw_usual;
*u++ = ch;
@@ -952,6 +957,8 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
case '?':
r->args_start = p;
goto done;
+ case '+':
+ r->plus_in_uri = 1;
default:
state = sw_usual;
*u++ = ch;
@@ -992,8 +999,6 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
if (ch == '\0') {
r->zero_in_uri = 1;
- *u++ = ch;
- ch = *p++;
}
state = quoted_state;
@@ -1003,10 +1008,15 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r)
c = (u_char) (ch | 0x20);
if (c >= 'a' && c <= 'f') {
ch = (u_char) ((decoded << 4) + c - 'a' + 10);
+
if (ch == '?') {
*u++ = ch;
ch = *p++;
+
+ } else if (ch == '+') {
+ r->plus_in_uri = 1;
}
+
state = quoted_state;
break;
}