diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index a04f409a..85518949 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -450,8 +450,11 @@ class Node extends HttpService */ public function dispatch(): mixed { - if (empty($this->callback) && $this->restructure()) { - return Json::to(404, $node->_error ?? 'Page not found.'); + if (empty($this->callback)) { + $this->restructure(); + if (empty($this->callback)) { + return Json::to(404, $node->_error ?? 'Page not found.'); + } } $requestParams = func_get_args();