From e6f9dbc683c630b2647eb59fd4b65d411172d2ca Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms <tleilax+studip@gmail.com> Date: Wed, 12 Oct 2022 12:13:16 +0000 Subject: [PATCH] set json content type in error handler, fixes #1659 Closes #1659 Merge request studip/studip!1068 --- lib/classes/JsonApi/Errors/ErrorHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/classes/JsonApi/Errors/ErrorHandler.php b/lib/classes/JsonApi/Errors/ErrorHandler.php index 93549b50a16..04224debfaf 100644 --- a/lib/classes/JsonApi/Errors/ErrorHandler.php +++ b/lib/classes/JsonApi/Errors/ErrorHandler.php @@ -35,6 +35,7 @@ class ErrorHandler } $response = $this->app->getResponseFactory()->createResponse(); + $response = $response->withHeader('Content-Type', 'application/json'); $response->getBody()->write($this->determinePayload($exception, $displayErrorDetails)); $code = $this->determineStatusCode($exception, $request->getMethod()); -- GitLab