summary refs log tree commit diff
path: root/src/middlewares/GlobalRateLimit.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/middlewares/GlobalRateLimit.ts')
-rw-r--r--src/middlewares/GlobalRateLimit.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/middlewares/GlobalRateLimit.ts b/src/middlewares/GlobalRateLimit.ts

index fc121911..38098981 100644 --- a/src/middlewares/GlobalRateLimit.ts +++ b/src/middlewares/GlobalRateLimit.ts
@@ -1,5 +1,6 @@ import { NextFunction, Request, Response } from "express"; -import Config from "../util/Config"; +import * as Config from '../util/Config' +import crypto from "crypto"; // TODO: use mongodb ttl index // TODO: increment count on serverside @@ -43,7 +44,7 @@ export async function GlobalRateLimit(req: Request, res: Response, next: NextFun } export function getIpAdress(req: Request): string { - const { forwadedFor } = Config.get().security; + const { forwadedFor } = Config.apiConfig.getAll().security; const ip = forwadedFor ? <string>req.headers[forwadedFor] : req.ip; return ip.replaceAll(".", "_").replaceAll(":", "_"); }