U4-1441 - fix issue with IIS taking over custom errors

This commit is contained in:
Stephan
2013-02-04 16:10:43 -01:00
parent 95df864d01
commit bfb36cac7c
2 changed files with 10 additions and 4 deletions

View File

@@ -334,8 +334,11 @@ namespace Umbraco.Web.Mvc
requestContext.HttpContext.Response.Redirect(publishedContentRequest.RedirectUrl, true);
return null;
}
if (publishedContentRequest.Is404) // should always be the case
requestContext.HttpContext.Response.StatusCode = 404;
if (publishedContentRequest.Is404) // should always be the case
{
requestContext.HttpContext.Response.StatusCode = 404;
requestContext.HttpContext.Response.TrySkipIisCustomErrors = true;
}
var handler = GetHandlerOnMissingTemplate(publishedContentRequest);
// if it's not null it can be either the PublishedContentNotFoundHandler (no document was

View File

@@ -115,8 +115,11 @@ namespace Umbraco.Web
httpContext.Response.Redirect(pcr.RedirectUrl, true);
return;
}
if (pcr.Is404)
httpContext.Response.StatusCode = 404;
if (pcr.Is404)
{
httpContext.Response.StatusCode = 404;
httpContext.Response.TrySkipIisCustomErrors = true;
}
if (!pcr.HasPublishedContent)
httpContext.RemapHandler(new PublishedContentNotFoundHandler());
else