gin icon indicating copy to clipboard operation
gin copied to clipboard

Refactor proxy logic

Open stefanbildl opened this issue 1 year ago • 0 comments

I refactored the code around setTrustedProxies.

  • prepareTrustedCIDRs does not need a reference to *Engine, only trustedProxies
  • renamed validateHeader function because its main use case is to get the trusted client IP
  • prepareCIDR method extracted from prepareTrustedCIDRs to make everything more readable
  • simplify tests a bit

Thank you for this great library :)

stefanbildl avatar Mar 25 '23 15:03 stefanbildl