echo
echo copied to clipboard
Remove square brackets from ipv6 addresses in XFF
Some loadbalancers (eg citrix ADC / netscaler) add square brackets around the ipv6 address in the X-Forwarded-For header. This PR removes them so that RealIP() and friends work correctly.
I do not understand why this change is only applied to IPs related to XForwardedFor. There are couple of more functions that could extract headers with square brackets.
Because netscaler only uses XForwardedFor, but I'll modify it for the others too if needed.
- ReplaceAll removed
- support for XRealIP added
- tests added
@aldas i've fixed it a while ago, any more remarks about this PR?
I am sorry for the delay. I often forget to recheck PRs