diff --git a/src/Constrict/Uri.php b/src/Constrict/Uri.php index c8c96b4..5c6dc4f 100644 --- a/src/Constrict/Uri.php +++ b/src/Constrict/Uri.php @@ -148,9 +148,6 @@ class Uri implements UriInterface public function getPath(): string { // TODO: Implement getPath() method. - if ($this->path === 'OPTIONS') { - $this->path = '/*'; - } return $this->path; } diff --git a/src/RouterCollector.php b/src/RouterCollector.php index 9501308..1dcf37e 100644 --- a/src/RouterCollector.php +++ b/src/RouterCollector.php @@ -215,6 +215,9 @@ class RouterCollector implements \ArrayAccess, \IteratorAggregate if (!$this->methods->has($method)) { return $this->default->get('handler'); } + if ($method === 'OPTIONS') { + $path = '/*'; + } $parent = $this->methods->get($method); /** @var HashMap $parent */