From: William A. Rowe Jr Date: Thu, 22 Jun 2006 08:00:40 +0000 (+0000) Subject: Stop appending a backslash if some trailing slash is present. X-Git-Tag: 2.3.0~2321 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb6b3dac930887eab83c6d721d0e63e7f5c050cd;p=thirdparty%2Fapache%2Fhttpd.git Stop appending a backslash if some trailing slash is present. For cross platform isapi we aught to find out what to add from apr, slash or backslash, but can't think of the trivial answer at this hour. PR: 15993 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@416291 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 263e3cbd451..03d077c04dd 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) mod_isapi: Avoid double trailing slashes in HSE_REQ_MAP_URL_TO_PATH + support (although this needs a bit more elegance for cross platform + isapi handling.) PR 15993 [William Rowe] + *) mod_isapi: Handle "HTTP/1.1 200 OK" style status lines correctly, the token parser worked while the resulting length was misinterpreted. PR 29098 [Brock Bland ] diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index e4ec5d004e6..5ccb61f50c9 100644 --- a/modules/arch/win32/mod_isapi.c +++ b/modules/arch/win32/mod_isapi.c @@ -960,9 +960,10 @@ int APR_THREAD_FUNC ServerSupportFunction(isapi_cid *cid, len = apr_cpystrn(file, subreq->filename, *buf_size) - file; - /* IIS puts a trailing slash on directories, Apache doesn't */ + /* IIS puts a trailing slash on directories, Apache may not */ if (subreq->finfo.filetype == APR_DIR) { - if (len < *buf_size - 1) { + if ((len < *buf_size - 1) && (file[len - 1] != '/') + && (file[len - 1] != '\\')) { file[len++] = '\\'; file[len] = '\0'; }