From b5f2c8df4345cf87dfdf8a2ffe0325d8a507efaf Mon Sep 17 00:00:00 2001 From: Yazeed Loonat Date: Wed, 20 Mar 2024 12:12:59 -0700 Subject: [PATCH] fix: Proxy attempt3 (#3967) * fix: possibly throttling through the proxy stuff * fix: changing logging to get some more info hopefully * fix: small logging tweak * fix: forwarding fix * fix: removings logs --- api/src/guards/throttler.guard.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/api/src/guards/throttler.guard.ts b/api/src/guards/throttler.guard.ts index cc6976f791..6d140e0d16 100644 --- a/api/src/guards/throttler.guard.ts +++ b/api/src/guards/throttler.guard.ts @@ -5,15 +5,9 @@ import { ThrottlerLimitDetail } from '@nestjs/throttler/dist/throttler.guard.int @Injectable() export class ThrottleGuard extends ThrottlerGuard { protected async getTracker(req: Record): Promise { - console.log( - 'forwarded for:', - req?.headers && req.headers['X-Forwarded-For'], - ); - console.log('ip:', req.ips.length ? req.ips : req.ip); - - if (req?.headers && req.headers['X-Forwarded-For']) { + if (req?.headers && req.headers['x-forwarded-for']) { // if we are passing through the proxy use forwarded for - return req.headers['X-Forwarded-For']; + return req.headers['x-forwarded-for']; } return req.ips.length ? req.ips[0] : req.ip; }