Welcome! Log In Create A New Profile

Advanced

[PATCH] Bugfix fastcgi_split_path_info

Frank Enderle
July 22, 2010 03:14PM
hi,

the following regex won't split correctly for nginx 0.8.46 due to a bug
in the capture offset processing. The problem occurs when the URI is not
fully captured but contains elements which should not be subject to the
split.

fastcgi_split_path_info ^/services(/[^/]+)(/?.*)$;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;

the following patch fixes the problem. it would be great if it could be
integrated in upcoming releases.

cheers,

frank.

--- ngx_http_fastcgi_module.c 2010-07-22 21:03:19.000000000 +0200
+++ ngx_http_fastcgi_module.c.orig 2010-07-22 21:03:01.000000000 +0200
@@ -2558,10 +2558,10 @@

if (n >= 0) { /* match */
f->script_name.len = captures[3] - captures[2];
- f->script_name.data = r->uri.data + captures[2];
+ f->script_name.data = r->uri.data;

f->path_info.len = captures[5] - captures[4];
- f->path_info.data = r->uri.data + captures[4];
+ f->path_info.data = r->uri.data + f->script_name.len;

return f;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Bugfix fastcgi_split_path_info

Frank Enderle 3376 July 22, 2010 03:14PM



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

Online Users

Guests: 313
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready