eee
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
namespace Kiri\Router\Format;
|
namespace Kiri\Router\Format;
|
||||||
|
|
||||||
use Kiri\Router\Constrict\Stream;
|
use Kiri\Router\Constrict\Stream;
|
||||||
use Kiri\Router\ContentType;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
class ArrayFormat implements IFormat
|
class ArrayFormat implements IFormat
|
||||||
@@ -16,9 +15,8 @@ class ArrayFormat implements IFormat
|
|||||||
*/
|
*/
|
||||||
public function call($result): ResponseInterface
|
public function call($result): ResponseInterface
|
||||||
{
|
{
|
||||||
$result = json_encode($result);
|
$result = json_encode($result, JSON_UNESCAPED_UNICODE);
|
||||||
|
return \response()->withBody(new Stream($result));
|
||||||
return \response()->withBody(new Stream(json_encode($result, JSON_UNESCAPED_UNICODE)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class MixedFormat implements IFormat
|
|||||||
if (is_array($result)) {
|
if (is_array($result)) {
|
||||||
return \response()->withContentType(ContentType::JSON)->withBody(new Stream(json_encode($result, JSON_UNESCAPED_UNICODE)));
|
return \response()->withContentType(ContentType::JSON)->withBody(new Stream(json_encode($result, JSON_UNESCAPED_UNICODE)));
|
||||||
} else {
|
} else {
|
||||||
return \response()->withBody(new Stream($result));
|
return \response()->withBody(new Stream((string)$result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user