From a5c8087ea4f8670f1557f73c875127bb6b060504 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 8 Jun 2022 10:17:38 +0200 Subject: [PATCH] BUGFIX: favicon.ico route for fixing invalid response --- config/routes.yaml | 5 +++++ src/Controller/SiteController.php | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/config/routes.yaml b/config/routes.yaml index 52579b9..0914496 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -14,6 +14,11 @@ health: defaults: _controller: App\Controller\SiteController::healthAction +favicon: + path: '/favicon.ico' + defaults: + _controller: App\Controller\SiteController::faviconAction + default_locale: path: '/{_locale}' defaults: diff --git a/src/Controller/SiteController.php b/src/Controller/SiteController.php index d1fdc32..54523ce 100644 --- a/src/Controller/SiteController.php +++ b/src/Controller/SiteController.php @@ -8,6 +8,7 @@ use Doctrine\Persistence\ManagerRegistry; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; class SiteController extends AbstractController @@ -26,4 +27,9 @@ class SiteController extends AbstractController ]; return new JsonResponse($return, $return['DaemonRunning'] ? 200 : 500); } + + public function faviconAction(Request $request) + { + return new Response('', 200); + } } \ No newline at end of file