Closed 64bit closed 9 months ago
If there are proxies in the chain that we don't control, and we know CloudFlare adds its IP to the right, the trustworthy IP would still be the second one from the right, not the leftmost one: https://adam-p.ca/blog/2022/03/x-forwarded-for/#trying-to-learn-about-x-forwarded-for
Thanks for sharing the link and your response, it does make sense from security perspective, after browsing docs what I'm looking for is already implemented in InsecureClientIp
, hence I'm closing the issue.
Hello,
Just like
RightmostXForwardedFor
having equivalentLeftmostXForwardedFor
will help extract Client IP fromX-Forwarded-For
header when request gets proxied through Cloudflare. Specially in situations whereCF-Connecting-IP
header is not available for requests going though other load balancers.More about why leftmost is in the doc below:
https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#x-forwarded-for
Thank you