From 4a815d302a819b1d4d86fd1970139ce23f9cd458 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 16 Feb 2021 11:22:51 +0100 Subject: :fire: disable rate limit for now -> wait till mongoose model exists --- src/index.ts | 1 - src/middlewares/GlobalRateLimit.ts | 2 ++ src/middlewares/RateLimit.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/index.ts b/src/index.ts index f4be661d..1ab17358 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ process.on("uncaughtException", console.error); process.on("unhandledRejection", console.error); -setTimeout(() => {}, 100000000); import { DiscordServer } from "./Server"; diff --git a/src/middlewares/GlobalRateLimit.ts b/src/middlewares/GlobalRateLimit.ts index 33dc5e0f..544bfdd8 100644 --- a/src/middlewares/GlobalRateLimit.ts +++ b/src/middlewares/GlobalRateLimit.ts @@ -8,6 +8,7 @@ import { db } from "fosscord-server-util"; export async function GlobalRateLimit(req: Request, res: Response, next: NextFunction) { return next(); // TODO: use new db mongoose models + /* if (!Config.get().limits.rate.ip.enabled) return next(); const ip = getIpAdress(req); @@ -39,6 +40,7 @@ export async function GlobalRateLimit(req: Request, res: Response, next: NextFun }); return next(); + */ } export function getIpAdress(req: Request): string { diff --git a/src/middlewares/RateLimit.ts b/src/middlewares/RateLimit.ts index b015c7e0..f4b76dfe 100644 --- a/src/middlewares/RateLimit.ts +++ b/src/middlewares/RateLimit.ts @@ -7,6 +7,7 @@ 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); @@ -40,5 +41,6 @@ export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) { } return next(); + */ }; } -- cgit 1.5.1