Fixes URL case sensitivity problem when there's a path between a wiki and the site root. Resolves #359.

This commit is contained in:
Andy Henderson 2009-10-02 19:23:06 +00:00
parent 8806160f26
commit 499c7bd777
2 changed files with 10 additions and 3 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0.336")]
[assembly: AssemblyFileVersion("3.0.0.336")]
[assembly: AssemblyVersion("3.0.0.337")]
[assembly: AssemblyFileVersion("3.0.0.337")]

View file

@ -600,7 +600,14 @@ namespace ScrewTurn.Wiki {
/// </summary>
public static string CookiePath {
get {
return HttpContext.Current.Request.ApplicationPath;
string requestUrl = HttpContext.Current.Request.RawUrl;
string virtualDirectory = HttpContext.Current.Request.ApplicationPath;
// We need to convert the case of the virtual directory to that used in the url
// Return the virtual directory as is if we can't find it in the URL
if (requestUrl.ToLower().Contains(virtualDirectory.ToLower())) {
return requestUrl.Substring(requestUrl.ToLower().IndexOf(virtualDirectory.ToLower()),virtualDirectory.Length);
}
return virtualDirectory;
}
}