[Mono-bugs] [Bug 553022] New: System.Web.Routing.RouteCollection.GetVirtualPath wrongly assumes !requestContext.HttpContext.Request.ApplicationPath.EndsWith("/")

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 5 16:41:39 EST 2009


           Summary: System.Web.Routing.RouteCollection.GetVirtualPath
                    wrongly assumes
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: sean.foy+novell at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=325854)
 --> (http://bugzilla.novell.com/attachment.cgi?id=325854)
Don't assume the absence of a trailing path separator in ApplicationPath

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv: Gecko/20091016 Firefox/3.5.4

System.Web.Routing.RouteCollection.GetVirtualPath contains this line of code:
var pathWithApp = String.Concat
(requestContext.HttpContext.Request.ApplicationPath, "/", vp.VirtualPath);

Note that we unconditionally add a path delimiter / between ApplicationPath and
vp.VirtualPath. Although ApplicationPath.EndsWith("/") is often false, it is
true for applications at the web root.

The method uses var to declare a local, so I think it's OK to use the 2.0+
VirtualPathUtility class to solve this problem. It treats ~, an IETF RFC-2396
unreserved character, specially, but I think that's OK too because literal ~s
in urls will be problematic in other parts of the standard library for the same

Patch attached.

Reproducible: Always

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list