From 9d571335235748dd4ef8c3d5ceda5e8e42432cdd Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 4 Feb 2023 12:19:24 +0100 Subject: Add response:content filter --- src/App.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/App.php') diff --git a/src/App.php b/src/App.php index 350247f..c6e8539 100644 --- a/src/App.php +++ b/src/App.php @@ -122,6 +122,8 @@ class App $content['error'] = basename(get_class($exception)) . ': ' . $exception->getMessage(); } + $content = $hooks->applyFilter('response:content', $content, $response); + $response->headers->set('Content-Type', 'application/json'); $response->headers->set('Access-Control-Allow-Origin', implode(',', $config['api']['cors']['origins'])); $response->setContent(json_encode($content)); -- cgit v1.2.3