Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed Sep 19, 2023
1 parent 3297f91 commit 2ca8815
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/backend/src/faucet/throttler.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import { Injectable } from '@nestjs/common'
@Injectable()
export class ThrottlerBehindProxyGuard extends ThrottlerGuard {
protected getTracker(req: Record<string, any>) {
console.log('headers', req.headers)
console.log('x-forwarded-for', req.headers['x-forwarded-for'])
console.log('connection.remoteAddress', req.connection.remoteAddress)
console.log('IPs from request headers', req.ips)
console.log('IP from request', req.ip)
return req.ips.length ? req.ips[0] : req.ip
return req.headers['x-forwarded-for']
? req.headers['x-forwarded-for']
: req.ip
}
}

0 comments on commit 2ca8815

Please sign in to comment.