public static MvcHtmlString GetAntiForgeryToken(this HtmlHelper helper) { if (DbConvention.IsStaticDomain()) { return(new MvcHtmlString(string.Empty)); } return(helper.AntiForgeryToken()); }
protected override void OnActionExecuting(ActionExecutingContext context) { if (this.Request?.Url != null) { this.CurrentDomain = this.Request.Url.DnsSafeHost; this.CurrentPageUrl = this.Request.Url.AbsoluteUri; this.Tenant = DbConvention.GetTenant(this.CurrentDomain); } bool isStatic = DbConvention.IsStaticDomain(this.CurrentDomain); if (isStatic) { //Static domains are strictly used for content caching only. context.Result = new HttpNotFoundResult("The requested page does not exist."); } else { base.OnActionExecuting(context); } }