From cb6b3dac930887eab83c6d721d0e63e7f5c050cd Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 22 Jun 2006 08:00:40 +0000 Subject: [PATCH] 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 --- CHANGES | 4 ++++ modules/arch/win32/mod_isapi.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 263e3cbd45..03d077c04d 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 e4ec5d004e..5ccb61f50c 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'; } -- 2.40.0