Fix use of $ip

This commit is contained in:
Luc Didry
2023-02-27 12:27:38 +00:00
parent 3a0f39761c
commit 34be40d928

View File

@@ -291,7 +291,7 @@ sub add {
$unauthorized_api = (!defined($c->req->headers->referrer) || Mojo::URL->new($c->req->headers->referrer)->host ne Mojo::URL->new('https://'.$c->req->headers->host)->host);
if ($unauthorized_api) {
my $msg = $c->l('Sorry, the API is disabled');
$c->app->log->info('Blocked API call for '.$ip);
$c->app->log->info('Blocked API call for '.$c->ip(1));
return $c->respond_to(
json => { json => { success => Mojo::JSON->false, msg => $msg } },
any => sub {