summary refs log tree commit diff
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-24 21:49:04 +0300
committerGitHub <noreply@github.com>2022-04-24 21:49:04 +0300
commitfb5c79eefa1aa44894fb963e1332b05df77d2663 (patch)
tree0c544e1684e5d5234f2a0db9bc7efce778239563
parentfix the seconds rounding logic (diff)
downloadserver-fb5c79eefa1aa44894fb963e1332b05df77d2663.tar.xz
Update RateLimit.ts
-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 b4f32131..f31aa5da 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";
 				reset = reset + opts.window * 1000; // each block violation pushes the expiry one full window further
-				offender.expires_at += opts.window * 1000;
+				offender.expires_at = offender.expires_at + opts.window * 1000;
 				resetAfterMs = reset - Date.now();
 				resetAfterSec = Math.ceil(resetAfterMs / 1000);