From 11b5123bbba58fba9ef51487e0e11777eaeedc23 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 8 May 2015 19:13:58 +1000 Subject: [PATCH] fixes datatokens dictionary check and ensures that webapi is initialized at the very end of the boot cycle. --- src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs | 3 ++- src/Umbraco.Web/WebBootManager.cs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs b/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs index ace4061985..0a6ce9f841 100644 --- a/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs +++ b/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs @@ -27,7 +27,8 @@ namespace Umbraco.Web.WebApi var routeData = request.GetRouteData(); if (routeData == null || routeData.Route == null - || routeData.Route.DataTokens == null + || routeData.Route.DataTokens == null + || routeData.Route.DataTokens.ContainsKey("Namespaces") == false || routeData.Route.DataTokens["Namespaces"] == null) return base.SelectController(request); diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index 972774574e..99bdaada4c 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -192,6 +192,9 @@ namespace Umbraco.Web } } + //Now ensure webapi is initialized after everything + GlobalConfiguration.Configuration.EnsureInitialized(); + return this; }