This commit is contained in:
xl
2024-08-29 15:56:30 +08:00
parent abb69cff20
commit 2058849059
7 changed files with 7 additions and 18 deletions
+1 -2
View File
@@ -29,13 +29,12 @@ class Head extends AbstractRequestMethod implements InjectMethodInterface
*/
public function dispatch(string $class, string $method): void
{
$controller = Kiri::getDi()->get($class);
// TODO: Implement dispatch() method.
$path = '/' . ltrim($this->path, '/');
if (!empty($this->version)) {
$path = '/' . trim($this->version) . $path;
}
Router::addRoute(RequestMethod::REQUEST_HEAD, $path, [$controller, $method]);
Router::addRoute(RequestMethod::REQUEST_HEAD, $path, [$class, $method]);
}