Skip to content

Commit 22a9fa2

Browse files
committed
TD_5410 Changes after discussion over moving the changs from class file to environment.
1 parent 04054db commit 22a9fa2

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

DigitalLearningSolutions.Web/Middleware/DLSIPRateLimitMiddleware.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,9 @@ public override Task ReturnQuotaExceededResponse(
3535
RateLimitRule rule,
3636
string retryAfter)
3737
{
38-
if (_configuration["ASPNETCORE_ENVIRONMENT"] == "PRODUCTION")
39-
{
40-
httpContext.Response.Headers["Location"] = "/toomanyrequests";
41-
httpContext.Response.StatusCode = 302;
42-
43-
}
38+
httpContext.Response.Headers["Location"] = "/toomanyrequests";
39+
httpContext.Response.StatusCode = 302;
4440
return httpContext.Response.WriteAsync("");
45-
4641
}
4742
}
4843
}

DigitalLearningSolutions.Web/appSettings.UAT.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@
2424
"MaxBulkUploadRows": 200,
2525
"LoginWithLearningHub": true
2626
},
27+
"IpRateLimiting": {
28+
"EnableEndpointRateLimiting": false,
29+
"StackBlockedRequests": false,
30+
"RealIpHeader": "X-Real-IP",
31+
"HttpStatusCode": 429,
32+
"GeneralRules": [
33+
{
34+
"Endpoint": "post:/ForgotPassword",
35+
"Period": "1m",
36+
"Limit": 5
37+
},
38+
{
39+
"Endpoint": "post:/Login",
40+
"Period": "1m",
41+
"Limit": 5
42+
}
43+
]
44+
},
2745
"LearningHubOpenAPIBaseUrl": "https://uks-learninghubnhsuk-openapi-test.azurewebsites.net",
2846
"FreshdeskAPIConfig": {
2947
"GroupId": "80000650208",

0 commit comments

Comments
 (0)