Skip to content

Commit

Permalink
Fix robots always injecting no-index
Browse files Browse the repository at this point in the history
Fixes #432
  • Loading branch information
Tam committed May 15, 2023
1 parent e377939 commit a9a6c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 1 addition & 3 deletions src/services/SeoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a9a6c9c

Please sign in to comment.