diff --git a/src/Canonical.php b/src/Canonical.php index 63f04ad54..ad618f2f0 100644 --- a/src/Canonical.php +++ b/src/Canonical.php @@ -166,7 +166,7 @@ public function setPath(?string $route = null, array $params = []): void { if (! $route && ! $this->request->attributes->has('_route')) { return; - } elseif ($this->request->attributes->has('_route')) { + } elseif (! $route) { $route = $this->request->attributes->get('_route'); }