diff --git a/HttpServer/Events/OnMessage.php b/HttpServer/Events/OnMessage.php index 436ffc96..3c543109 100644 --- a/HttpServer/Events/OnMessage.php +++ b/HttpServer/Events/OnMessage.php @@ -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.'); } diff --git a/HttpServer/Http/Request.php b/HttpServer/Http/Request.php index 3dae28b2..e09fd37e 100644 --- a/HttpServer/Http/Request.php +++ b/HttpServer/Http/Request.php @@ -7,6 +7,7 @@ use Exception; use HttpServer\Application; use HttpServer\IInterface\AuthIdentity; +use JetBrains\PhpStorm\Pure; use ReflectionException; use Snowflake\Core\Json; use Snowflake\Exception\ComponentException; @@ -202,7 +203,7 @@ class Request extends Application /** * @return string */ - public function getCurrent(): string + #[Pure] public function getCurrent(): string { return current($this->explode); }