strip double / on path-info

git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@79 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Jan Kneschke 2005-03-02 18:36:32 +00:00
parent 85194f365f
commit b68e4a2f2c
1 changed files with 7 additions and 3 deletions

View File

@ -917,7 +917,12 @@ handler_t http_response_prepare(server *srv, connection *con) {
}
/* not found, perhaps PATHINFO */
buffer_copy_string_buffer(srv->tmp_buf, con->physical.rel_path);
if (con->physical.rel_path->ptr[0] == '/') {
buffer_copy_string_len(srv->tmp_buf, con->physical.rel_path->ptr + 1, con->physical.rel_path->used - 2);
} else {
buffer_copy_string_buffer(srv->tmp_buf, con->physical.rel_path);
}
/*
*
@ -987,13 +992,12 @@ handler_t http_response_prepare(server *srv, connection *con) {
con->uri.path->used -= strlen(pathinfo);
con->uri.path->ptr[con->uri.path->used - 1] = '\0';
}
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- after pathinfo check");
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
log_error_write(srv, __FILE__, __LINE__, "sb", "URI :", con->uri.path);
log_error_write(srv, __FILE__, __LINE__, "sb", "Pathinfo :", con->request.pathinfo);
}