Skip to content

Commit

Permalink
refactor: use craft\web\Response as WebResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jun 23, 2024
1 parent b8280d7 commit c6bc418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/Redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c6bc418

Please sign in to comment.