geoip: skip lookups for localhost
This commit is contained in:
parent
3acc6dd3d9
commit
03e7ef722c
@ -195,6 +195,7 @@ sub geoip2_lookup {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $ip = $self->qp->connection->remote_ip;
|
my $ip = $self->qp->connection->remote_ip;
|
||||||
|
return DECLINED if $self->is_localhost($ip);
|
||||||
|
|
||||||
if ($self->{_geoip2_city}) {
|
if ($self->{_geoip2_city}) {
|
||||||
my $city_rec = $self->{_geoip2_city}->city(ip => $ip);
|
my $city_rec = $self->{_geoip2_city}->city(ip => $ip);
|
||||||
@ -223,6 +224,8 @@ sub geoip2_lookup {
|
|||||||
sub geoip_lookup {
|
sub geoip_lookup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
return DECLINED if $self->is_localhost($self->qp->connection->remote_ip);
|
||||||
|
|
||||||
# reopen the DB if Geo::IP failed due to DB update
|
# reopen the DB if Geo::IP failed due to DB update
|
||||||
$self->open_geoip_db();
|
$self->open_geoip_db();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user