This commit is contained in:
xl
2023-11-22 10:35:50 +08:00
parent 576e1c3ad8
commit 95b0822822
3 changed files with 41 additions and 5 deletions
+18
View File
@@ -29,6 +29,9 @@ class Handler implements RequestHandlerInterface
protected mixed $format;
protected array $methods = [];
/**
* @var ContainerInterface
*/
@@ -69,6 +72,21 @@ class Handler implements RequestHandlerInterface
}
/**
* @param string $method
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
public function setRequestMethod(string $method): void
{
if ($method == 'HEAD') {
$this->format = $this->container->get(NoBody::class);
}
}
/**
* @return bool
*/