strip ... and %20 from physical filenames only on windows

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@1018 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Jan Kneschke 2006-03-04 14:53:29 +00:00
parent 9cba4350ab
commit 85fc576437
1 changed files with 6 additions and 0 deletions

View File

@ -320,6 +320,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
buffer_copy_string_buffer(con->physical.doc_root, con->conf.document_root);
buffer_copy_string_buffer(con->physical.rel_path, con->uri.path);
#if defined(__WIN32) || defined(__CYGWIN__)
/* strip dots from the end and spaces
*
* windows/dos handle those filenames as the same file
@ -328,7 +329,11 @@ handler_t http_response_prepare(server *srv, connection *con) {
*
* This will affect in some cases PATHINFO
*
* on native windows we could prepend the filename with \\?\ to circumvent
* this behaviour. I have no idea how to push this through cygwin
*
* */
if (con->physical.rel_path->used > 1) {
buffer *b = con->physical.rel_path;
size_t i;
@ -349,6 +354,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
}
}
}
#endif
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- before doc_root");