diff --git a/src/global_functions.php b/src/global_functions.php index d040de9..0fb17b7 100644 --- a/src/global_functions.php +++ b/src/global_functions.php @@ -69,7 +69,9 @@ function mdShortenerExceptionHandler(Throwable $exception):void { $errorReporter = new MDErrorReporter("md:frontend", "bugs-frontend@museum-digital.de"); $errorCategory = MDErrorReporter::categorizeError($exception); - http_response_code(404); + if (headers_sent() === false) { + http_response_code(404); + } switch ($errorCategory) { case MDErrorReporter::MD_ERROR_KNOWN: