From b801199e7cf1add15d5f6b2dd2a176df9fb936e6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 8 Jan 2021 15:30:35 +1100 Subject: [PATCH] missing commit --- .../Routing/UmbracoRouteValuesFactory.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs b/src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs index c4f89bf8aa..fd92f7f11e 100644 --- a/src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs +++ b/src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs @@ -99,8 +99,6 @@ namespace Umbraco.Web.Website.Routing /// /// Check if the route is hijacked and return new route values /// - /// - /// private UmbracoRouteValues CheckHijackedRoute(UmbracoRouteValues def) { IPublishedRequest request = def.PublishedRequest; @@ -131,11 +129,12 @@ namespace Umbraco.Web.Website.Routing { IPublishedRequest request = def.PublishedRequest; - // Here we need to check if there is no hijacked route and no template assigned, - // if this is the case we want to return a blank page. + // Here we need to check if there is no hijacked route and no template assigned but there is a content item. + // If this is the case we want to return a blank page. // We also check if templates have been disabled since if they are then we're allowed to render even though there's no template, // for example for json rendering in headless. - if (!request.HasTemplate() + if (request.HasPublishedContent() + && !request.HasTemplate() && !_umbracoFeatures.Disabled.DisableTemplates && !def.HasHijackedRoute) {