Fixed Hyperf\GrpcServer\Utils\Parser::deserializeMessage() must be of the type string, object given

This commit is contained in:
李铭昕 2018-12-29 09:55:18 +08:00
parent 766433b658
commit 73a187c684

View File

@ -141,7 +141,8 @@ class CoreMiddleware extends HttpCoreMiddleware
$parentClass = $class->getParentClass();
if ($parentClass->getName() === ProtobufMessage::class) {
$request = $this->request();
return Parser::deserializeMessage([$class->getName(), null], $request->getBody());
$stream = $request->getBody();
return Parser::deserializeMessage([$class->getName(), null], $stream->getContents());
}
if (!$this->container->has($definition['ref']) && !$definition['allowsNull']) {