- Issue created by @JohnLuk
- Status changed to Needs review
3 months ago 7:55am 13 November 2024 - 🇮🇳India harivenuv India
Patch: Extract the first IP address from comma-separated `HTTP_X_FORWARDED_FOR` header
- Updated the Reverse Proxy Header module to properly handle multiple IP addresses in the `HTTP_X_FORWARDED_FOR` header.
- The module now extracts and uses the first IP address from a comma-separated list.
- Ensures that only the first non-private, non-reserved IP address is used, improving compatibility with multiple proxy setups.
- Fixes potential issues where the module could incorrectly handle multiple forwarded IP addresses, leading to incorrect client IP detection. - 🇺🇦Ukraine bohart Lutsk, Ukraine
Thanks for your contribution.
1) It looks like we should check for the first valid IP address in some foreach (instead of picking up the first address in the list and checking its validity), isn't it?
2) The maintainer of this module works only with Merge requests (instead of patch files).
Looking forward,
- Merge request !7Issue #3425451: Multiple IPs returning, split and use 1st one → (Closed) created by harivenuv
- Merge request !9Issue #3425451 by harivenuv, bohart: Handle multiple IPs in the header (split and use first valid one). → (Merged) created by bohart
- 🇺🇦Ukraine bohart Lutsk, Ukraine
Hi @harivenuv,
Thanks for your contribution and the detailed description of the merge request!Please be aware that you changed the 1.0.x branch (instead of the 3425451-multiple-ips-returning branch).
1.0.x, 1.1.x, etc. (as the development branches) should remain intact in the forks.
You also have committed some unrelated changes (a line break in the comment).In addition, there was no test coverage. I have added those (with some code refactoring).
Committed to 1.1.x-dev branch. Those will be a part of the next module release.Thanks!
- Status changed to Fixed
about 1 month ago 9:04pm 23 January 2025 Automatically closed - issue fixed for 2 weeks with no activity.