Prevent sending error status codes via error handler when headers are already sent
This commit is contained in:
parent
ae65868021
commit
ab3150254f
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user