diff --git a/src/services/Redirects.php b/src/services/Redirects.php index 3f679ecc..e8481dd6 100644 --- a/src/services/Redirects.php +++ b/src/services/Redirects.php @@ -20,6 +20,7 @@ use craft\errors\SiteNotFoundException; use craft\helpers\Db; use craft\helpers\StringHelper; +use craft\web\Response as WebResponse; use DateTime; use nystudio107\retour\events\RedirectEvent; use nystudio107\retour\events\RedirectResolvedEvent; @@ -879,7 +880,7 @@ public function doRedirect(string $fullUrl, string $pathOnly, ?array $redirect): // Sanitize the URL $dest = UrlHelper::sanitizeUrl($dest); // Optionally set the no-cache headers - if (Retour::$settings->setNoCacheHeaders && $response instanceof \yii\web\Response) { + if (Retour::$settings->setNoCacheHeaders && $response instanceof WebResponse) { $response->setNoCacheHeaders(); } // Add any additional headers (existing ones will be replaced)