Skip to content

Commit

Permalink
🐛 Fix X-Forwarded-For not working
Browse files Browse the repository at this point in the history
  • Loading branch information
GiyoMoon committed Apr 4, 2023
1 parent e11767c commit d5f4eba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/plausible/plausible.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class PlausibleService {
'X-Forwarded-Proto': request.headers['cf-visitor']
? JSON.parse(request.headers['cf-visitor'] as string).scheme
: request.protocol,
'X-Forwarded-For': request.headers['cf-connecting-ip']
'cf-connecting-ip': request.headers['cf-connecting-ip']
? (request.headers['cf-connecting-ip'] as string)
: request.ip,
'X-Forwarded-Host': request.hostname,
Expand All @@ -35,9 +35,6 @@ export class PlausibleService {
body = raw.toString().trim();
}

console.log(body);
console.log(forwardedHeaders);

await this.httpService.axiosRef.post(
`${process.env.PLAUSIBLE_HOST}/api/event`,
body,
Expand Down

0 comments on commit d5f4eba

Please sign in to comment.