改名
This commit is contained in:
@@ -455,7 +455,7 @@ class Router extends Application implements RouterInterface
|
|||||||
* @return Node|false|int|mixed|string|null
|
* @return Node|false|int|mixed|string|null
|
||||||
* 树干搜索
|
* 树干搜索
|
||||||
*/
|
*/
|
||||||
private function find_path($request)
|
private function find_path(Request $request)
|
||||||
{
|
{
|
||||||
$method = $request->getMethod();
|
$method = $request->getMethod();
|
||||||
if (!isset($this->nodes[$method])) {
|
if (!isset($this->nodes[$method])) {
|
||||||
@@ -463,13 +463,13 @@ class Router extends Application implements RouterInterface
|
|||||||
}
|
}
|
||||||
$methods = $this->nodes[$method];
|
$methods = $this->nodes[$method];
|
||||||
$uri = $request->headers->get('request_uri', '/');
|
$uri = $request->headers->get('request_uri', '/');
|
||||||
if (!isset($methods[$uri])) {
|
if (isset($methods[$uri])) {
|
||||||
if ($request->isOption && !isset($methods['/'])) {
|
return $methods[$uri];
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return $this->nodes[$method]['/'];
|
|
||||||
}
|
}
|
||||||
return $this->nodes[$method][$uri];
|
if (!$request->isOption || !isset($methods['/'])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $methods['/'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user