From fa753709b2f8a33520eab10dd33b6abbeca56389 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 Mar 2024 10:14:33 +0100 Subject: [PATCH] Controller: Serve JSON if accepted fixes #988 --- library/Icingadb/Web/Controller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index 91b28a044..95cd3c5c8 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -514,6 +514,9 @@ public function preDispatch() parent::preDispatch(); $this->format = $this->params->shift('format'); + if ($this->getRequest()->isApiRequest()) { + $this->format = 'json'; + } } public function postDispatch()