diff --git a/http-server/Constrict/Response.php b/http-server/Constrict/Response.php index f510c0ba..09f1ad97 100644 --- a/http-server/Constrict/Response.php +++ b/http-server/Constrict/Response.php @@ -38,8 +38,8 @@ class Response implements ResponseInterface 'format' => ContentType::JSON, 'charset' => 'utf-8' ]); - $this->withContentType($contentType['format']) - ->withCharset($contentType['charset']); + $this->withContentType($contentType['format'] ?? ContentType::JSON) + ->withCharset($contentType['charset'] ?? 'utf-8'); }