From 566b52dbae8909f055b136ebdee2ad349640f836 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 22 Jun 2024 23:56:46 -0400 Subject: [PATCH] refactor: use craft\web\Response as WebResponse --- src/services/Redirects.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/Redirects.php b/src/services/Redirects.php index a2350ec5..3a7fdccc 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; @@ -332,7 +333,7 @@ public function doRedirect(string $fullUrl, string $pathOnly, $redirect): bool // 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)