Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed URI normalization with merge_slashes switched off.

October 08, 2019 03:00PM
details: https://hg.nginx.org/nginx/rev/6208c5418c88
branches:
changeset: 7579:6208c5418c88
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Oct 08 21:56:14 2019 +0300
description:
Fixed URI normalization with merge_slashes switched off.

Previously, "/foo///../bar" was normalized into "/foo/bar"
instead of "/foo//bar".

diffstat:

src/http/ngx_http_parse.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 79bcbe7cd3f2 -r 6208c5418c88 src/http/ngx_http_parse.c
--- a/src/http/ngx_http_parse.c Tue Oct 08 21:56:14 2019 +0300
+++ b/src/http/ngx_http_parse.c Tue Oct 08 21:56:14 2019 +0300
@@ -1471,7 +1471,7 @@ ngx_http_parse_complex_uri(ngx_http_requ
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_requ
u--;

} else if (state == sw_dot_dot) {
- u -= 5;
+ u -= 4;

for ( ;; ) {
if (u < r->uri.data) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed URI normalization with merge_slashes switched off.

ru@nginx.com 56 October 08, 2019 03:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready