@@ -6,7 +6,6 @@ namespace LearningHub.Nhs.WebUI.Controllers
66 using System . Linq ;
77 using System . Net . Http ;
88 using System . Threading . Tasks ;
9- using elfhHub . Nhs . Models . Common ;
109 using LearningHub . Nhs . Models . Content ;
1110 using LearningHub . Nhs . Models . Enums . Content ;
1211 using LearningHub . Nhs . Models . Extensions ;
@@ -21,7 +20,6 @@ namespace LearningHub.Nhs.WebUI.Controllers
2120 using Microsoft . AspNetCore . Diagnostics ;
2221 using Microsoft . AspNetCore . Hosting ;
2322 using Microsoft . AspNetCore . Mvc ;
24- using Microsoft . Extensions . Configuration ;
2523 using Microsoft . Extensions . Logging ;
2624 using Microsoft . Extensions . Options ;
2725 using Microsoft . FeatureManagement ;
@@ -54,7 +52,6 @@ public class HomeController : BaseController
5452 /// <param name="dashboardService">Dashboard service.</param>
5553 /// <param name="contentService">Content service.</param>
5654 /// <param name="featureManager"> featureManager.</param>
57- /// <param name="configuration"> config.</param>
5855 public HomeController (
5956 IHttpClientFactory httpClientFactory ,
6057 IWebHostEnvironment hostingEnvironment ,
@@ -65,8 +62,7 @@ public HomeController(
6562 LearningHubAuthServiceConfig authConfig ,
6663 IDashboardService dashboardService ,
6764 IContentService contentService ,
68- IFeatureManager featureManager ,
69- Microsoft . Extensions . Configuration . IConfiguration configuration )
65+ IFeatureManager featureManager )
7066 : base ( hostingEnvironment , httpClientFactory , logger , settings . Value )
7167 {
7268 this . authConfig = authConfig ;
@@ -75,7 +71,6 @@ public HomeController(
7571 this . dashboardService = dashboardService ;
7672 this . contentService = contentService ;
7773 this . featureManager = featureManager ;
78- this . configuration = configuration ;
7974 }
8075
8176 /// <summary>
@@ -170,26 +165,16 @@ public IActionResult Error(int? httpStatusCode)
170165 }
171166 else
172167 {
173- if ( originalPath == "/TooManyRequests" )
168+ this . ViewBag . ErrorHeader = httpStatusCode . Value switch
174169 {
175- this . ViewBag . Period = this . configuration [ "IpRateLimiting:GeneralRules:0:Period" ] ;
176- this . ViewBag . Limit = this . configuration [ "IpRateLimiting:GeneralRules:0:Limit" ] ;
177-
178- return this . View ( "TooManyRequests" ) ;
179- }
180- else
181- {
182- this . ViewBag . ErrorHeader = httpStatusCode . Value switch
183- {
184- 401 => "You do not have permission to access this page" ,
185- 404 => "We cannot find the page you are looking for" ,
186- _ => "We cannot find the page you are looking for" ,
187- } ;
170+ 401 => "You do not have permission to access this page" ,
171+ 404 => "We cannot find the page you are looking for" ,
172+ _ => "We cannot find the page you are looking for" ,
173+ } ;
188174
189- this . ViewBag . HttpStatusCode = httpStatusCode . Value ;
190- this . ViewBag . HomePageUrl = "/home" ;
191- return this . View ( "CustomError" ) ;
192- }
175+ this . ViewBag . HttpStatusCode = httpStatusCode . Value ;
176+ this . ViewBag . HomePageUrl = "/home" ;
177+ return this . View ( "CustomError" ) ;
193178 }
194179 }
195180
0 commit comments