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

index 5186ae80..38098981 100644 --- a/src/middlewares/GlobalRateLimit.ts +++ b/src/middlewares/GlobalRateLimit.ts
@@ -44,8 +44,7 @@ export async function GlobalRateLimit(req: Request, res: Response, next: NextFun } export function getIpAdress(req: Request): string { - const rateLimitProperties = Config.apiConfig.get('security', {jwtSecret: crypto.randomBytes(256).toString("base64"), forwadedFor: null, captcha: {enabled:false, service: null, sitekey: null, secret: null}}) as Config.DefaultOptions; - const { forwadedFor } = rateLimitProperties.security; + const { forwadedFor } = Config.apiConfig.getAll().security; const ip = forwadedFor ? <string>req.headers[forwadedFor] : req.ip; return ip.replaceAll(".", "_").replaceAll(":", "_"); }