This commit is contained in:
as2252258@163.com
2021-08-28 02:09:08 +08:00
parent 5e1a3f7148
commit 316a44f59c
+2 -1
View File
@@ -65,7 +65,8 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect
{ {
$this->response->withStatus(200); $this->response->withStatus(200);
if (is_array($responseData)) { 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)); return $this->response->withBody(new Stream((string)$responseData));
} }