Check uri instead of physical path for directory redirect

* should fix alias handling for "/foo" => "/var/www/";
   http://example.com/foo should result in a redirect to
   http://example.com/foo/

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2720 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Stefan Bühler 2010-04-13 15:47:29 +00:00
parent 221af3d59d
commit a48aa0f023
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ NEWS
* Fix handling return value of SSL_CTX_set_options (fixes #2157, thx mlcreech)
* Fix mod_proxy HUP handling (send final chunk, fix usage counter)
* mod_proxy: close connection on write error (fixes #2114)
* Check uri instead of physical path for directory redirect
- 1.4.26 - 2010-02-07
* Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)

View File

@ -581,7 +581,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
};
#endif
if (S_ISDIR(sce->st.st_mode)) {
if (con->physical.path->ptr[con->physical.path->used - 2] != '/') {
if (con->uri.path->ptr[con->uri.path->used - 2] != '/') {
/* redirect to .../ */
http_response_redirect_to_directory(srv, con);