Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ServiceStack v3.9.55.0 - Dynamically add OPTIONS to all routes
/// Call this ad the end of your app host Configure(Funq.Container container) method
private void AddOptionsVerbToAllRoutes(IServiceRoutes routes)
{
var map = EndpointHost.ServiceManager.ServiceController.RestPathMap;
foreach (var key in map.Keys)
{
foreach (RestPath rp in map[key])
{
routes.Add(rp.RequestType, rp.Path, "OPTIONS");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.