This commit is contained in:
2021-08-30 17:11:37 +08:00
parent 15185405fb
commit 3d4c4bcd54
+3 -3
View File
@@ -390,7 +390,6 @@ class Router extends HttpService implements RouterInterface
/** /**
* @param array|null $explode * @param array|null $explode
* @param $method
* @return Node|null * @return Node|null
* 查找指定路由 * 查找指定路由
* @throws Exception * @throws Exception
@@ -537,18 +536,19 @@ class Router extends HttpService implements RouterInterface
* @param RequestInterface $request * @param RequestInterface $request
* @return Node|null * @return Node|null
* 树杈搜索 * 树杈搜索
* @throws Exception
*/ */
public function Branch_search(RequestInterface $request): ?Node public function Branch_search(RequestInterface $request): ?Node
{ {
$uri = $request->getUri(); $uri = $request->getUri();
$node = $this->tree_search($uri->getExplode(), $request->getMethod()); $node = $this->tree_search($uri->getExplode());
if ($node instanceof Node) { if ($node instanceof Node) {
return $node; return $node;
} }
if (!$request->isMethod('OPTIONS')) { if (!$request->isMethod('OPTIONS')) {
return null; return null;
} }
$node = $this->tree_search(['*'], $request->getMethod()); $node = $this->tree_search(['*']);
if (!($node instanceof Node)) { if (!($node instanceof Node)) {
return null; return null;
} }