From 316a44f59cf9337dd8b9b2af45df4d92621155cf Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 28 Aug 2021 02:09:08 +0800 Subject: [PATCH] 111 --- http-server/Service/Http.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http-server/Service/Http.php b/http-server/Service/Http.php index 888eacd3..359e002f 100644 --- a/http-server/Service/Http.php +++ b/http-server/Service/Http.php @@ -65,7 +65,8 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect { $this->response->withStatus(200); if (is_array($responseData)) { - return $this->response->withBody(new Stream(json_encode($responseData, JSON_UNESCAPED_UNICODE))); + return $this->response->withBody(new Stream(json_encode($responseData, JSON_UNESCAPED_UNICODE))) + ->withContentType(\Server\Message\Response::CONTENT_TYPE_JSON); } return $this->response->withBody(new Stream((string)$responseData)); }