Closed rdev5 closed 8 years ago
Affects: https://github.com/Torann/laravel-geoip/issues/55
Error: The address ::1 is not in the database.
The address ::1 is not in the database.
I haven't seen any from 127.0.0.1 (IPv4), but GeoIP2 fills up logs very quickly with the above error and stack trace when the error is thrown (discovered by rap2hpoutre/laravel-log-viewer) at https://github.com/maxmind/GeoIP2-php/blob/master/src/Database/Reader.php#L220-L224
Consider adding the following (or a similar implementation) to skip database check if the IP is private:
function is_private_IP($ip) { return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE); }
Source: https://arjunphp.com/check-if-an-ip-address-is-private-with-php/
This API throws exceptions on private IPs and other IPs not in the database, as documented. This is the intended behavior. If you do not want this behavior, please consider using MaxMind\Db\Reader directly instead.
MaxMind\Db\Reader
Affects: https://github.com/Torann/laravel-geoip/issues/55
Error:
The address ::1 is not in the database.
I haven't seen any from 127.0.0.1 (IPv4), but GeoIP2 fills up logs very quickly with the above error and stack trace when the error is thrown (discovered by rap2hpoutre/laravel-log-viewer) at https://github.com/maxmind/GeoIP2-php/blob/master/src/Database/Reader.php#L220-L224
Consider adding the following (or a similar implementation) to skip database check if the IP is private:
Source: https://arjunphp.com/check-if-an-ip-address-is-private-with-php/