summary refs log tree commit diff
path: root/src/middlewares/RateLimit.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 19:01:41 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-14 19:01:41 +0100
commita94f7c76172d83b95f43b059b9a5af4299eb2f8d (patch)
treeab0ea2cf4c90d927747701abcc80a95d2d75721f /src/middlewares/RateLimit.ts
parentutil function to emit event (diff)
downloadserver-a94f7c76172d83b95f43b059b9a5af4299eb2f8d.tar.xz
switch to mongoose
Diffstat (limited to 'src/middlewares/RateLimit.ts')
-rw-r--r--src/middlewares/RateLimit.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/middlewares/RateLimit.ts b/src/middlewares/RateLimit.ts

index c42d773c..b015c7e0 100644 --- a/src/middlewares/RateLimit.ts +++ b/src/middlewares/RateLimit.ts
@@ -5,6 +5,9 @@ import { getIpAdress } from "./GlobalRateLimit"; export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) { return async (req: Request, res: Response, next: NextFunction) => { + return next(); + // TODO: use new db mongoose models + let id = req.userid || getIpAdress(req); const limit: { count: number; start: number } = (await db.data.ratelimit.routes[name][id].get()) || {