Merge pull request #1275 from ranma42/fix-lib64
[mono.git] / mcs / class / System.Web / System.Web.Security / FormsAuthenticationModule.cs
index 8e53da606761925de1254da2425aee7d6a6bb636..cab57fea2f2ff83ab4b858d4e5947ac9b7c4d058 100644 (file)
@@ -28,6 +28,7 @@
 //
 
 using System.ComponentModel;
+using System.Globalization;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Text;
@@ -109,14 +110,17 @@ namespace System.Web.Security
                        slidingExpiration = _config.SlidingExpiration;
 #endif
 
-                       string reqPath = "";
+                       if (!VirtualPathUtility.IsRooted (loginPage))
+                               loginPage = "~/" + loginPage;
+
+                       string reqPath = String.Empty;
                        string loginPath = null;
                        try {
                                reqPath = context.Request.PhysicalPath;
                                loginPath = context.Request.MapPath (loginPage);
                        } catch {} // ignore
 
-                       context.SkipAuthorization = (reqPath == loginPath);
+                       context.SkipAuthorization = String.Compare (reqPath, loginPath, RuntimeHelpers.CaseInsensitive, Helpers.InvariantCulture) == 0;
                        
 #if NET_2_0
                        //TODO: need to check that the handler is System.Web.Handlers.AssemblyResourceLoader type