diff options
Diffstat (limited to 'src/Middleware/ErrorHandler.php')
-rw-r--r-- | src/Middleware/ErrorHandler.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Middleware/ErrorHandler.php b/src/Middleware/ErrorHandler.php index 9fc34722..29b1fac1 100644 --- a/src/Middleware/ErrorHandler.php +++ b/src/Middleware/ErrorHandler.php @@ -48,6 +48,10 @@ class ErrorHandler implements MiddlewareInterface $statusCode = $response->getStatusCode(); $contentType = $response->getHeader('content-type'); $contentType = array_shift($contentType); + if (!$contentType && strpos($response->getBody(), '<html') !== false) { + $contentType = 'text/html'; + } + if ( $statusCode < 400 || !$response instanceof Response |