Skip to content

Commit

Permalink
Controller: Serve JSON if accepted
Browse files Browse the repository at this point in the history
fixes #988
  • Loading branch information
nilmerg committed Mar 22, 2024
1 parent 1230fae commit fa75370
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/Icingadb/Web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fa75370

Please sign in to comment.