Browse Source

Fix workaround for incorrect path info/scriptname if scgi prefix is "/" (fixes #729)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2498 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 13 years ago
parent
commit
9c53e2ef80
  1. 1
      NEWS
  2. 10
      src/mod_scgi.c

1
NEWS

@ -38,6 +38,7 @@ NEWS
* Fix SERVER_NAME port stripping (fixes #1968)
* Fix x-sendfile 2gb limiting (fixes #1970)
* Fix mod_cgi environment keys mangling (fixes #1969)
* Fix workaround for incorrect path info/scriptname if scgi prefix is "/" (fixes #729)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

10
src/mod_scgi.c

@ -2838,7 +2838,11 @@ static handler_t scgi_check_extension(server *srv, connection *con, void *p_d, i
*/
/* the rewrite is only done for /prefix/? matches */
if (extension->key->ptr[0] == '/' &&
if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
con->uri.path->used = 1;
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
} else if (extension->key->ptr[0] == '/' &&
con->uri.path->used > extension->key->used &&
NULL != (pathinfo = strchr(con->uri.path->ptr + extension->key->used - 1, '/'))) {
/* rewrite uri.path and pathinfo */
@ -2847,10 +2851,6 @@ static handler_t scgi_check_extension(server *srv, connection *con, void *p_d, i
con->uri.path->used -= con->request.pathinfo->used - 1;
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
} else if (host->fix_root_path_name && extension->key->ptr[0] == '/' && extension->key->ptr[1] == '\0') {
buffer_copy_string(con->request.pathinfo, con->uri.path->ptr);
con->uri.path->used = 1;
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
}
}
} else {

Loading…
Cancel
Save