Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Make it possible to replace the HttpControllerRouteHandler [715]

$
0
0
I have a requirement which requires me to provide a custom IHttpAsyncHandler but it's nearly impossible to safely replace the HttpControllerRouteHandler (as this is the one who provides the IHttpHandler instance). HttpControllerRouteHandler.Instance is being used all over the System.Web.Http.WebHost project (e.g: HttpRouteExtensions.ToRoute extension method).

It would be easier if I can replace this through the GlobalConfiguration for example:

GlobalConfiguration.DefaultRouteHandler = new MyCustomRouteHandler();

This might not be as safe as it should be cuz this must be changed as early as possible as GlobalConfiguration.DefaultRouteHandler will be used while registering routes.

Thoughts?
Comments: Hi Hongmei, Thanks for looking into this. Yep, it's doable with a new routing extension. However, I really don't prefer that option. I understand that this is one of the parts which is questionable to be extensible but would be a nice extensibility. What I basically try to do here is to trip the cancellation tokens, which are provided by the ASP.NET, through the HttpHandler with HttpMessageInvoker instance. So, I would like to change the handler there. The best way to do this (to me) is to change the RouteHandler. There might be other cases for that where it's necessary to tweak the HttpHandler. So, I really would like to see this extensibility point. Thanks again!

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>