diff --git a/backend/src/Controller/Posters/GetPosterAction.php b/backend/src/Controller/Posters/GetPosterAction.php index 32133e1..2345b5b 100644 --- a/backend/src/Controller/Posters/GetPosterAction.php +++ b/backend/src/Controller/Posters/GetPosterAction.php @@ -3,6 +3,7 @@ namespace App\Controller\Posters; use App\Environment; +use App\Exception\NotFoundException; use App\Http\Response; use App\Http\ServerRequest; use App\Media; @@ -140,11 +141,9 @@ public function __invoke( ); } - // Default poster if no other image is found. + // Return 404 if poster image isn't found if (null === $image) { - $image = file_get_contents( - Environment::getBaseDirectory() . '/web/static/img/no_poster.jpg' - ); + throw NotFoundException::poster($request); } $response->getBody()->write($image);