Skip to content

Commit

Permalink
fix: ip fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
samialdury committed Aug 7, 2023
1 parent 7d2f195 commit 387008e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/http/headers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('HTTP server', () => {
})
})

it.only('Should handle x-forwarded-for as a string array', () => {
it('Should handle x-forwarded-for as a string array', () => {
const originalHeaders = {
'x-forwarded-for': '91.69.97.18, 100.254.100.215, 162.157.33.117',
}
Expand Down
2 changes: 1 addition & 1 deletion src/http/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function parseIp(
? xForwardedFor[0]
: xForwardedFor.includes(',')
? xForwardedFor.split(',')[0]
: request.ip
: xForwardedFor
}

return request.ip
Expand Down

0 comments on commit 387008e

Please sign in to comment.