echo icon indicating copy to clipboard operation
echo copied to clipboard

Remove square brackets from ipv6 addresses in XFF

Open 42wim opened this issue 2 years ago • 2 comments

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.

42wim avatar May 16 '22 22:05 42wim

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.

42wim avatar May 21 '22 21:05 42wim

  • ReplaceAll removed
  • support for XRealIP added
  • tests added

42wim avatar May 21 '22 22:05 42wim

@aldas i've fixed it a while ago, any more remarks about this PR?

42wim avatar Nov 22 '22 21:11 42wim

I am sorry for the delay. I often forget to recheck PRs

aldas avatar Nov 24 '22 20:11 aldas