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

Fail-fast on IP addresses that will always return AddressNotFoundException #108

Open
davidklebanoff opened this issue May 23, 2018 · 1 comment

Comments

@davidklebanoff
Copy link

There are certain IP addresses that will always result in an AddressNotFoundException such as those in private address spaces (e.g. 10.0.0.0 – 10.255.255.255).

It would be nice if the client checked and returned an AddressNotFoundException (or perhaps a new child class such as PrivateAddressException) instead hitting the API, resulting in wasted time on wire and use of API credits.

I'm not sure what the full set of reserved/private and otherwise hardcoded "bad" ip ranges would be, but a good start would be to do a quick call such as ip.isAnyLocalAddress() before calling out to the MaxMind API.

@oschwald
Copy link
Member

That does sound like a useful enhancement. Perhaps isSiteLocalAddress could be used.

As an aside, MaxMind does not charge for failed requests.

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

No branches or pull requests

2 participants