diff --git a/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs b/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs index 0b43dc921..1f98a1c03 100644 --- a/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs +++ b/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs @@ -1,36 +1,12 @@ -using System.Net; -using System.Web.Mvc; -using Orchard.Mvc; +using System.Web.Mvc; using Orchard.Themes; namespace Orchard.Core.Common.Controllers { [Themed] public class ErrorController : Controller { - private readonly IOrchardServices _orchardServices; - - public ErrorController(IOrchardServices orchardServices) { - _orchardServices = orchardServices; - } public ActionResult NotFound(string url) { - Response.StatusCode = (int)HttpStatusCode.NotFound; - var model = _orchardServices.New.NotFound(); - - if(url == null) { - url = Request.Url.OriginalString; - } - - // If the url is relative then replace with Requested path - model.RequestedUrl = Request.Url.OriginalString.Contains(url) & Request.Url.OriginalString != url ? - Request.Url.OriginalString : url; - - // Dont get the user stuck in a 'retry loop' by - // allowing the Referrer to be the same as the Request - model.ReferrerUrl = Request.UrlReferrer != null && - Request.UrlReferrer.OriginalString != model.RequestedUrl ? - Request.UrlReferrer.OriginalString : null; - - return new ShapeResult(this, model); + return HttpNotFound(); } } } \ No newline at end of file