diff options
Diffstat (limited to 'src/Middleware')
-rw-r--r-- | src/Middleware/ErrorHandler.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Middleware/ErrorHandler.php b/src/Middleware/ErrorHandler.php index c99ac24f..9fc34722 100644 --- a/src/Middleware/ErrorHandler.php +++ b/src/Middleware/ErrorHandler.php @@ -46,7 +46,13 @@ class ErrorHandler implements MiddlewareInterface } $statusCode = $response->getStatusCode(); - if ($statusCode < 400 || !$response instanceof Response) { + $contentType = $response->getHeader('content-type'); + $contentType = array_shift($contentType); + if ( + $statusCode < 400 + || !$response instanceof Response + || !empty($contentType) + ) { return $response; } |