vat icon indicating copy to clipboard operation
vat copied to clipboard

IPv6 and the Geolocators

Open MarcSollie opened this issue 5 years ago • 1 comments

So firstly, I just noticed that the standard geoip-service, ip2c.org, doesn't support IPv6. That, combined with the fact that the ip2country.info service is only for open source projects, might create some issues.

Secondly, the provider for ip2country.info uses urlencode() on the ip-addresses. While that doesn't cause issues for Ipv4 addresses (a period . is encoded to a period .), it does cause issues for IPv6 addresses, which uses colons instead of periods. Colons : are translated to %3A, while the ip2country.info API expects a :.

I'm going to be submitting a pull request which fixes this issue in a few minutes, by removing the urlencode. But it might be wise to consider a ip2country service which allows closed-source projects to use it with IPv6, so closed-source projects can use this library with IPv6.

I might end up submitting a pull request with a new service, if I can find a IPv6-ready, GDPR-compliant IP2Country service.

MarcSollie avatar Feb 23 '20 16:02 MarcSollie

I'm going to be submitting a pull request which fixes this issue in a few minutes, by removing the urlencode.

I created the pull request at #27.

MarcSollie avatar Feb 23 '20 16:02 MarcSollie