This commit is contained in:
2023-09-15 16:05:48 +08:00
parent 3d6099ea6e
commit ceadca4d83
+6 -4
View File
@@ -99,11 +99,13 @@ class Handler implements RequestHandlerInterface
return $result; return $result;
} }
if (is_object($result)) { if (is_object($result)) {
$result = '[object]'; return \response()->withBody(new Stream('[object]'));
} else if (is_array($result)) { }
$result = json_encode($result, JSON_UNESCAPED_UNICODE); if (is_array($result)) {
return \response()->withContentType(ContentType::JSON)->withBody(new Stream(json_encode($result, JSON_UNESCAPED_UNICODE)));
} else {
return \response()->withBody(new Stream($result));
} }
return \response()->withBody(new Stream($result));
} }
} }