private static void AppPostStart() { Routes.RegisterRoutes(RouteTable.Routes); Routes.RegisterServiceRoutes(RouteTable.Routes); AreaRegistration.RegisterAllAreas(); GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute()); GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter()); GlobalFilters.Filters.Add(new AntiForgeryErrorFilter()); ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory()); }
private static void AppPostStart(IAppConfiguration configuration) { Routes.RegisterRoutes(RouteTable.Routes, configuration.FeedOnlyMode); Routes.RegisterServiceRoutes(RouteTable.Routes); AreaRegistration.RegisterAllAreas(); GlobalFilters.Filters.Add(new SendErrorsToTelemetryAttribute { View = "~/Views/Errors/InternalError.cshtml" }); GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter()); GlobalFilters.Filters.Add(new AntiForgeryErrorFilter()); ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory()); }
private static void AppPostStart() { Routes.RegisterRoutes(RouteTable.Routes); Routes.RegisterServiceRoutes(RouteTable.Routes); AreaRegistration.RegisterAllAreas(); GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute()); GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter()); GlobalFilters.Filters.Add(new RequireRemoteHttpsAttribute() { OnlyWhenAuthenticated = true }); ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory()); }
private static void AppPostStart(IAppConfiguration configuration) { Routes.RegisterRoutes(RouteTable.Routes); Routes.RegisterServiceRoutes(RouteTable.Routes); AreaRegistration.RegisterAllAreas(); GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute()); GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter()); GlobalFilters.Filters.Add(new AntiForgeryErrorFilter()); var googleAnalyticsId = configuration.GoogleAnalyticsPropertyId; if (googleAnalyticsId != null) { var tracker = new Tracker(googleAnalyticsId, configuration.SiteRoot, new CookieBasedAnalyticsSession()); GlobalFilters.Filters.Add(new GoogleAnalyticsTracker.Web.Mvc.ActionTrackingAttribute(tracker, descriptor => { var controllerType = descriptor.ControllerDescriptor.ControllerType; return(typeof(ApiController).IsAssignableFrom(controllerType) || typeof(JsonController).IsAssignableFrom(controllerType)); })); } ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory()); }