Skip to content

Commit

Permalink
fix getting client's ip address from behind of proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitry-lzs committed Jan 10, 2024
1 parent 7e0d026 commit 97f2e29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parameters/geoip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface GeoIp extends FingerprintResultComponent {

export const geoip: FingerprintParameter<GeoIp> = function (next) {
const ip =
(this.req.headers["x-forwarded-for"] || "").split(",").pop() ||
(this.req.headers["x-forwarded-for"] || "").split(",")[0] ||
this.req.connection?.remoteAddress ||
this.req.socket?.remoteAddress ||
this.req.connection?.socket?.remoteAddress ||
Expand Down

0 comments on commit 97f2e29

Please sign in to comment.