Skip to content

Conversation

@whs
Copy link

@whs whs commented Apr 10, 2019

Closes #6

Only continue parsing IP backwards if the proxy is in allowed IP range.

This PR breaks the public interface by introducing allowed function parameter into Parse. Also the Parse behavior is now changed:

  • If invalid address are found, the last valid IP are returned instead of silently skipping those invalid address.
  • Local IP address can now be returned (IsPublicIP become unused function) as all local proxy IP should be listed in AllowedSubnets.

I believe this breaking change is justified as it prevents people from having security issues by not providing insecure validation mechanism. It should be released as versioned package though (eg. using gopkg.in)

@whs
Copy link
Author

whs commented Apr 11, 2019

Found some more bugs where it wouldn't work with internal proxies. Looking into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant