🐛 — Fix bug introduced in !87

This commit is contained in:
Luc Didry
2023-04-26 12:26:11 +02:00
parent 47a67a428d
commit c3c3c7a780

View File

@@ -288,7 +288,7 @@ sub add {
my $wm = $c->param('watermark');
if ($c->config('disable_api')) {
$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);
my $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 '.$c->ip(1));