summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2019-10-08 21:56:14 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2019-10-08 21:56:14 +0300
commit85137dd2a639bea7424f742cdebd9773ce7a2081 (patch)
treebaf5c574f74b8786a4ffed535f1e98bb36f0ffa3
parented42131da63a106f91e5f8416a9add3720850827 (diff)
downloadnginx-85137dd2a639bea7424f742cdebd9773ce7a2081.tar.gz
nginx-85137dd2a639bea7424f742cdebd9773ce7a2081.tar.bz2
Fixed URI normalization with merge_slashes switched off.
Previously, "/foo///../bar" was normalized into "/foo/bar" instead of "/foo//bar".
-rw-r--r--src/http/ngx_http_parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index ed5cf7506..aa56b976d 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -1471,7 +1471,7 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r, ngx_uint_t merge_slashes)
case '/':
case '?':
case '#':
- u -= 5;
+ u -= 4;
for ( ;; ) {
if (u < r->uri.data) {
return NGX_HTTP_PARSE_INVALID_REQUEST;
@@ -1575,7 +1575,7 @@ ngx_http_parse_complex_uri(ngx_http_request_t *r, ngx_uint_t merge_slashes)
u--;
} else if (state == sw_dot_dot) {
- u -= 5;
+ u -= 4;
for ( ;; ) {
if (u < r->uri.data) {