summary refs log tree commit diff
path: root/api
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-24 23:07:25 +0300
committerErkin Alp Güney <erkinalp9035@gmail.com>2022-04-24 23:07:25 +0300
commitc9c660f7a788dea94f8f5826db96e9a7c7e4e71f (patch)
treea244017a61a59414207917e1526e53522d7e8160 /api
parentUpdate RateLimit.ts (diff)
downloadserver-c9c660f7a788dea94f8f5826db96e9a7c7e4e71f.tar.xz
eventually fix those errors
Diffstat (limited to 'api')
-rw-r--r--api/src/middlewares/RateLimit.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/middlewares/RateLimit.ts b/api/src/middlewares/RateLimit.ts
index 4bbef520..81668034 100644
--- a/api/src/middlewares/RateLimit.ts
+++ b/api/src/middlewares/RateLimit.ts
@@ -71,7 +71,7 @@ export default function rateLimit(opts: {
 			if (offender.blocked) {
 				const global = bucket_id === "global";
 				// each block violation pushes the expiry one full window further
-				reset = new Date(reset.getTime() + opts.window * 1000);
+				reset += opts.window * 1000;
 				offender.expires_at = new Date(offender.expires_at.getTime() + opts.window * 1000);
 				resetAfterMs = reset - Date.now();
 				resetAfterSec = Math.ceil(resetAfterMs / 1000);