Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly parse nested proxy #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Properly parse nested proxy #10

wants to merge 2 commits into from

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