From: Maxim Dounin Date: Tue, 8 Oct 2019 18:56:14 +0000 (+0300) Subject: Fixed URI normalization with merge_slashes switched off. X-Git-Tag: release-1.17.5~8 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=85137dd2a639bea7424f742cdebd9773ce7a2081;p=nginx.git Fixed URI normalization with merge_slashes switched off. Previously, "/foo///../bar" was normalized into "/foo/bar" instead of "/foo//bar". --- 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) {