-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X-Forwarded-For is parsed incorrectly! #28
Comments
Not a bug. IPs are processed last-to-first to prevent IP spoofing. If we trusted the first IP, it'd be trivial to spoof the IP of a request by setting a fake header, like Further reading:
If you know 150.172.238.178 and 70.41.3.18 are trusted proxies, configure the |
Thank you for your reply and pointing to some articles with more information 😃 . |
Sure thing. Hope it makes sense. :) |
Given an X-Forwarded-For header like
203.0.113.195, 70.41.3.18, 150.172.238.178
remote_ip will currently replace the request's IP with
150.172.238.178
.(e.g.
)
However, this is incorrect. according to MDN the client IP is the first one in this list.
The text was updated successfully, but these errors were encountered: