2009-11-09 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Mon, 9 Nov 2009 14:21:09 +0000 (14:21 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 9 Nov 2009 14:21:09 +0000 (14:21 -0000)
* RouteCollection.cs: GetVirtualPath doesn't append trailing slash
to application path blindly anymore. Fixes bug #553022

svn path=/trunk/mcs/; revision=145740

mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog
mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs

index 65c9a78008fb2d53aeb0adecd84aaa04564751a8..033357c40ba4294a1023b6005784b4ca02eda220 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-09  Marek Habersack  <mhabersack@novell.com>
+
+       * RouteCollection.cs: GetVirtualPath doesn't append trailing slash
+       to application path blindly anymore. Fixes bug #553022
+
 2009-09-09  Marek Habersack  <mhabersack@novell.com>
 
        * Route.cs: when Url is set to null, create a parser for empty
index 67d3543a1596b763e8dce4843b8f503159a328fe..c140ffac213a23f44c8ca016c22e44165ce163e6 100644 (file)
@@ -167,7 +167,11 @@ namespace System.Web.Routing
                        }
 
                        if (vp != null) {
-                               var pathWithApp = String.Concat (requestContext.HttpContext.Request.ApplicationPath, "/", vp.VirtualPath);
+                               string appPath = requestContext.HttpContext.Request.ApplicationPath;
+                               if (appPath != null && (appPath.Length == 0 || !appPath.EndsWith ("/", StringComparison.Ordinal)))
+                                       appPath += "/";
+                               
+                               string pathWithApp = String.Concat (appPath, vp.VirtualPath);
                                vp.VirtualPath = requestContext.HttpContext.Response.ApplyAppPathModifier (pathWithApp);
                                return vp;
                        }