This commit is contained in:
2021-02-20 16:15:01 +08:00
parent f672fab504
commit dc1b7a9c0b
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ namespace HttpServer\Events;
use Annotation\Route\Socket;
use Exception;
use HttpServer\Abstracts\Callback;
use HttpServer\Http\Context;
use Snowflake\Event;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
@@ -63,7 +64,8 @@ class OnMessage extends Callback
throw new Exception('Format error.');
}
$router = Snowflake::app()->getRouter();
$node = $router->search('/' . Socket::MESSAGE . '::' . $route, 'sw::socket');
$node = $router->tree_search(explode('/', Socket::MESSAGE . '::' . $route), 'sw::socket');
if ($node === null) {
throw new Exception('Page not found.');
}