mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 01:57:55 +08:00
Prevent IIS 7 classic mode from handling custom error/not found page
--HG-- branch : 1.x
This commit is contained in:
@@ -55,6 +55,9 @@ namespace Orchard.Exceptions.Filters {
|
||||
else {
|
||||
filterContext.Result = new ShapeResult(filterContext.Controller, shape);
|
||||
filterContext.RequestContext.HttpContext.Response.StatusCode = 500;
|
||||
|
||||
// prevent IIS 7.0 classic mode from handling the 404/500 itself
|
||||
filterContext.RequestContext.HttpContext.Response.TrySkipIisCustomErrors = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,6 +79,9 @@ namespace Orchard.Exceptions.Filters {
|
||||
|
||||
filterContext.Result = new ShapeResult(filterContext.Controller, model);
|
||||
filterContext.RequestContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
|
||||
// prevent IIS 7.0 classic mode from handling the 404/500 itself
|
||||
filterContext.RequestContext.HttpContext.Response.TrySkipIisCustomErrors = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user