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 Tugberk, Can you write your custom route or your extension to register your custom route handler? What is the scenario that you will need to do this? thanks! hongmei
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 Tugberk, Can you write your custom route or your extension to register your custom route handler? What is the scenario that you will need to do this? thanks! hongmei