summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-02-04 12:19:24 +0100
committerDaniel Weipert <code@drogueronin.de>2023-02-04 12:19:24 +0100
commit9d571335235748dd4ef8c3d5ceda5e8e42432cdd (patch)
treeca2ef74b6c97792248db176de7d49d264a425f19 /src
parent9a6d8b6b7b4b406ee3c63d07be2d2956d744f0f6 (diff)
Add response:content filter
Diffstat (limited to 'src')
-rw-r--r--src/App.php2
1 files changed, 2 insertions, 0 deletions
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));