This commit is contained in:
2020-09-04 18:25:28 +08:00
parent 0f07ddd6a5
commit 412ebc1afc
+2 -2
View File
@@ -427,10 +427,10 @@ class Router extends Application implements RouterInterface
return JSON::to(404, 'Page not found.');
}
if (!in_array($request->getMethod(), $node->method)) {
return JSON::to(405, 'Page not found.');
return JSON::to(405, 'Method not allowed.');
}
if (empty($node->callback)) {
return JSON::to(404, 'Page not found.');
return JSON::to(404, 'Method does not exist.');
}
return call_user_func($node->callback, $request);
}