There's nothing wrong with HttpWebRoute when you call MapHttpRoute. The scenario I'm talking about is the following:
1. You want to customize GetRouteData and GetVirtualPath, so you create a specialized IHttpRoute, eg. MyHttpRoute
2. You add MyHttpRoute to GlobalConfiguration.Configuration.Routes, which adds a HttpWebRoute that wraps MyHttpRoute to RouteTable.Routes
3. Calls to HttpWebRoute.GetRouteData or HttpWebRoute.GetVirtualPath do not call the same method on the wrapped MyHttpRoute, so the custom behaviour is not executed
Of course, this should be the case only when HttpWebRoute wraps an instance that is not HostedHttpRoute, because HostedHttpRoute wraps HttpWebRoute, which would result in an infinite loop.
HttpWebRoute should be an adapter for MyHttpRoute, just like HostedHttpRoute is an adapter for HttpWebRoute.
Makes sense?
Comments: This already fixed.
1. You want to customize GetRouteData and GetVirtualPath, so you create a specialized IHttpRoute, eg. MyHttpRoute
2. You add MyHttpRoute to GlobalConfiguration.Configuration.Routes, which adds a HttpWebRoute that wraps MyHttpRoute to RouteTable.Routes
3. Calls to HttpWebRoute.GetRouteData or HttpWebRoute.GetVirtualPath do not call the same method on the wrapped MyHttpRoute, so the custom behaviour is not executed
Of course, this should be the case only when HttpWebRoute wraps an instance that is not HostedHttpRoute, because HostedHttpRoute wraps HttpWebRoute, which would result in an infinite loop.
HttpWebRoute should be an adapter for MyHttpRoute, just like HostedHttpRoute is an adapter for HttpWebRoute.
Makes sense?
Comments: This already fixed.