Closed vanisoul closed 4 months ago
Will release a fix for it
If you using array in checkHeaders it will be at least priority.
But if you using string like checkHeaders: "cf-connecting-ip"
.
It will first priority.
I think a better idea would be to disable forced X-Forwaded-For header checking when using custom headers.
@vanisoul Thank you for reporting this what @armada45-pixel suggested will work and in array also, it will work.
Description: I'm experiencing an issue with the elysia-ip when specifying headers for IP retrieval. Despite setting cf-connecting-ip as the header to check, the middleware is still returning the IP from the x-forwarded-for header.
Node.js Version: v20.11.0 Elysia Version: v1.0.20 elysia-ip Version: v1.0.5 bun Version: v1.0.26
Run the following curl command to test
Observe that the console output shows the IP from x-forwarded-for instead of cf-connecting-ip. Console Output: