Skip to content

Commit

Permalink
修复无法通过配置文件设置 WebSocket 服务的 dataParser (#681)
Browse files Browse the repository at this point in the history
* 修复无法通过配置文件设置 WebSocket 服务的 dataParser

* 修复测试
  • Loading branch information
Yurunsoft authored Feb 24, 2024
1 parent 528b3cf commit 9acd3d0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Imi\Bean\Annotation\Bean;
use Imi\ConnectionContext;
use Imi\RequestContext;
use Imi\Server\DataParser\JsonObjectParser;
use Imi\Server\Http\Message\Contract\IHttpRequest;
use Imi\Server\Http\Message\Contract\IHttpResponse;
use Imi\Server\Server;
Expand Down Expand Up @@ -55,7 +54,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
/** @var \Imi\Server\Http\Route\RouteResult $routeResult */
$routeResult = $requestContext['routeResult'] ?? null;
ConnectionContext::muiltiSet([
'dataParser' => $routeResult->routeItem->wsConfig->parserClass ?? JsonObjectParser::class,
'dataParser' => $routeResult->routeItem->wsConfig->parserClass ?? null,
'uri' => (string) $request->getUri(),
]);

Expand Down

0 comments on commit 9acd3d0

Please sign in to comment.