Fixing Url.HttpRouteUrl usage

Fixes #4766
This commit is contained in:
Sebastien Ros
2016-03-31 16:30:30 -07:00
parent dfd045005b
commit fbb3047195

View File

@@ -71,6 +71,14 @@ namespace Orchard.Mvc.Routes {
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) {
// only if MVC or WebApi match for this route
object httpRouteValue;
if (values.TryGetValue("httproute", out httpRouteValue)) {
if (httpRouteValue is bool && (bool)httpRouteValue != IsHttpRoute) {
return null;
}
}
// locate appropriate shell settings for request
var settings = _runningShellTable.Match(requestContext.HttpContext);