Fixes: #U4-2343 for api controllers, already fixed for surface controllers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user