From a9a6c9c1fee943f44ed09277f1c0e21ca279067d Mon Sep 17 00:00:00 2001 From: Tam Date: Mon, 15 May 2023 16:40:31 +0100 Subject: [PATCH] Fix robots always injecting no-index Fixes #432 --- CHANGELOG.md | 4 ++++ src/services/SeoService.php | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02206c8..edbe635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.1.2 - 2023-05-15 +### Fixed +- Fix robots always injecting no-index (Fixes #432) + ## 4.1.1 - 2023-04-19 ### Fixed - Fix redirect page 500 error (Fixes #448) diff --git a/src/services/SeoService.php b/src/services/SeoService.php index ba32ede..e3dc409 100644 --- a/src/services/SeoService.php +++ b/src/services/SeoService.php @@ -23,10 +23,8 @@ public function injectRobots () { $headers = Craft::$app->getResponse()->getHeaders(); - $env = App::env('ENVIRONMENT') ?? App::env('CRAFT_ENVIRONMENT'); - // Always noindex except on production environment - if ($env !== 'production') + if (Craft::$app->env !== 'production') { $headers->set('x-robots-tag', 'none, noimageindex'); return;