Created
July 15, 2013 19:43
-
-
Save marfarma/6002805 to your computer and use it in GitHub Desktop.
// // public overload of ServiceStackHttpHandlerFactory.GetCatchAllHandlerIfAny, adds function parameter, for CatchAllHandlers the want to // all other CatchAllHandlers to have precedence. Prevents infinite recursion //
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// public overload of ServiceStackHttpHandlerFactory.GetCatchAllHandlerIfAny, adds function parameter, for CatchAllHandlers the want to | |
// all other CatchAllHandlers to have precedence. Prevents infinite recursion | |
// | |
public static IHttpHandler GetCatchAllHandlerIfAny(string httpMethod, string pathInfo, string filePath, function skipCatchAllHandler) | |
{ | |
if (EndpointHost.CatchAllHandlers != null) | |
{ | |
foreach (var httpHandlerResolver in EndpointHost.CatchAllHandlers) | |
{ | |
if (httpHandlerResolver == skipCatchAllHandler) continue; // avoid infinite recursion | |
var httpHandler = httpHandlerResolver(httpMethod, pathInfo, filePath); | |
if (httpHandler != null) | |
return httpHandler; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment