改名
This commit is contained in:
@@ -7,6 +7,7 @@ use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\Controller;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
@@ -416,6 +417,7 @@ class Router extends HttpService implements RouterInterface
|
||||
* @param $method
|
||||
* @return Node|null
|
||||
* 查找指定路由
|
||||
* @throws RequestException
|
||||
*/
|
||||
public function tree_search(?array $explode, $method): ?Node
|
||||
{
|
||||
@@ -427,7 +429,7 @@ class Router extends HttpService implements RouterInterface
|
||||
while ($value = array_shift($explode)) {
|
||||
$node = $parent->findNode($value);
|
||||
if (!$node) {
|
||||
break;
|
||||
throw new RequestException('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>', 404);
|
||||
}
|
||||
$parent = $node;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user