This commit is contained in:
2021-04-01 11:28:42 +08:00
parent e56ab4a364
commit c337ad99a4
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -41,10 +41,11 @@ class OnReceive extends Callback
if (($node = $router->find_path($request)) === null) {
return $server->send($fd, Json::encode(['state' => 404]));
}
$dispatch = $node->dispatch();
if (!is_string($dispatch)) $dispatch = Json::encode($dispatch);
if (empty($dispatch)) {
return true;
}
return $server->send($fd, $dispatch);
} catch (\Throwable $exception) {
$this->addError($exception, 'receive');