Fix rate limit not applying correctly

This commit is contained in:
Infi
2024-08-26 00:15:00 +02:00
parent f6ea2c0dd3
commit f97da5d3fd
+1 -1
View File
@@ -124,7 +124,7 @@ public class RouteController
private async Task<bool> AuthenticateClient(HttpContextBase ctx)
{
var currentTick = Environment.TickCount64;
if (RateLimit.TryGetValue(ctx.Request.Source.IpAddress, out var timestamp) && timestamp < currentTick)
if (RateLimit.TryGetValue(ctx.Request.Source.IpAddress, out var timestamp) && timestamp > currentTick)
return await Redirect(ctx, "/", "message", "Rate limit active.");
// The next request will be rate limited for 10s