diff options
author | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-04-24 23:07:25 +0300 |
---|---|---|
committer | Erkin Alp Güney <erkinalp9035@gmail.com> | 2022-04-24 23:07:25 +0300 |
commit | c9c660f7a788dea94f8f5826db96e9a7c7e4e71f (patch) | |
tree | a244017a61a59414207917e1526e53522d7e8160 /api/src | |
parent | Update RateLimit.ts (diff) | |
download | server-c9c660f7a788dea94f8f5826db96e9a7c7e4e71f.tar.xz |
eventually fix those errors
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/middlewares/RateLimit.ts | 2 |
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); |