[Mono-bugs] [Bug 651593] New: Mono differs significantly from .NET FX when processing URL routes in System.Web.Routing

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 5 02:11:40 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=651593

https://bugzilla.novell.com/show_bug.cgi?id=651593#c0


           Summary: Mono differs significantly from .NET FX when
                    processing URL routes in System.Web.Routing
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: bassam at symform.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12)
Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)

With a route such as "/Foo", .NET FX will not match it with a URL such as
"/Foo/123". Mono however considers this a match. Below is an isolated test
case.


Reproducible: Always

Steps to Reproduce:
using System;
using System.Collections.Specialized;
using System.Web;
using System.Web.Routing;

namespace MonoRoutingBug
{
    class Program
    {
        static void Main(string[] args)
        {
            Route route = new Route("Foo", new RouteValueDictionary(new {
controller = "Foo", action = "Index" }), new DummyRouteHandler());
            RouteData data = route.GetRouteData(new
DummyHttpContext("/Foo/123"));
            // Expected : null to be retruned (.NET FX returns null)
            // Actual: Mono return data with { controller = "Foo", action =
"Index" }
        }
    }

    class DummyRouteHandler : IRouteHandler
    {
        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            return null;
        }
    }

    class DummyHttpRequest: HttpRequestBase
    {
        private Uri url;

        public DummyHttpRequest(string urlString)
        {
            url = new Uri(new Uri("http://localhost"), urlString);
        }

        public override string AppRelativeCurrentExecutionFilePath { get {
return "~" + url.LocalPath; } }
        public override string PathInfo { get { return string.Empty; } }
        public override NameValueCollection QueryString { get { return
HttpUtility.ParseQueryString(url.Query); } }
    }

    class DummyHttpContext : HttpContextBase
    {
        private DummyHttpRequest req;

        public DummyHttpContext(string urlString)
        {
            req = new DummyHttpRequest(urlString);
        }

        public override HttpRequestBase Request { get { return req; } }
    }
}

-- 
Configure bugmail: https://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