rejectRequest never returns null
This commit is contained in:
parent
628c50572e
commit
9fc80730f1
1 changed files with 3 additions and 1 deletions
|
@ -133,7 +133,9 @@ abstract class RateLimiter<User> {
|
|||
// user over the rate limit.
|
||||
else if (currentWindow.pointsConsumed > maxPointsPerWindow) {
|
||||
await sendWindowInformation(req, res, currentWindow);
|
||||
return await rejectRequest(req, res, currentWindow, now);
|
||||
var result = await rejectRequest(req, res, currentWindow, now);
|
||||
if (result != null) return result;
|
||||
return false;
|
||||
} else {
|
||||
// Add the cost of the current endpoint, and update the window.
|
||||
var cost = await getEndpointCost(req, res, currentWindow);
|
||||
|
|
Loading…
Reference in a new issue