Skip to content

Commit

Permalink
Fixed URI normalization with merge_slashes switched off.
Browse files Browse the repository at this point in the history
Previously, "/foo///../bar" was normalized into "/foo/bar"
instead of "/foo//bar".
  • Loading branch information
mdounin committed Oct 8, 2019
1 parent ed42131 commit 85137dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/ngx_http_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 85137dd

Please sign in to comment.