From 273c1956ab5e52b17d846bed72e90e1e055eb755 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 15:46:36 +1000 Subject: [PATCH] Fixes: #U4-2343 for api controllers, already fixed for surface controllers --- src/Umbraco.Web/Mvc/PluginControllerArea.cs | 2 +- src/Umbraco.Web/WebBootManager.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/Mvc/PluginControllerArea.cs b/src/Umbraco.Web/Mvc/PluginControllerArea.cs index 0e34e2cdef..2d4c1a56ce 100644 --- a/src/Umbraco.Web/Mvc/PluginControllerArea.cs +++ b/src/Umbraco.Web/Mvc/PluginControllerArea.cs @@ -85,7 +85,7 @@ namespace Umbraco.Web.Mvc { foreach (var s in apiControllers) { - this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "Api", "", UrlParameter.Optional, "api", isMvc: false); + this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "", UrlParameter.Optional, "api", isMvc: false); } } } diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index 94384aaca4..b2507f2174 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -209,9 +209,8 @@ namespace Umbraco.Web var meta = PluginController.GetMetadata(controller); var route = RouteTable.Routes.MapHttpRoute( string.Format("umbraco-{0}-{1}", "api", meta.ControllerName), - umbracoPath + "/Api/" + meta.ControllerName + "/{action}/{id}",//url to match - new { controller = meta.ControllerName, id = UrlParameter.Optional }, - new { controller = @"(\w+)Api" }); //Must be suffixed with "Api" (i.e. MyApiController) + umbracoPath + "/Api/" + meta.ControllerName + "/{action}/{id}", //url to match + new {controller = meta.ControllerName, id = UrlParameter.Optional}); //web api routes don't set the data tokens object if (route.DataTokens == null) {