diff --git a/http-handler/Handler.php b/http-handler/Handler.php index bd575866..9730dcb4 100644 --- a/http-handler/Handler.php +++ b/http-handler/Handler.php @@ -39,6 +39,9 @@ class Handler $dispatcher = Kiri::getDi()->get(EventProvider::class); $dispatcher->on(OnAfterWorkerStart::class, function () { + if ($this->route instanceof Closure) { + return; + } $this->_middlewares = MiddlewareManager::get($this->route); }); }