From c8bf87323dd5f90dfe8226238ad8c43df772300d Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Wed, 28 Aug 2024 08:46:03 +0100 Subject: [PATCH 1/2] set x-robots-tag for preview links too --- src/web/Application.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/Application.php b/src/web/Application.php index f934e83aedc..072c34b624e 100644 --- a/src/web/Application.php +++ b/src/web/Application.php @@ -191,6 +191,7 @@ public function handleRequest($request, bool $skipSpecialHandling = false): Base $generalConfig->disallowRobots || $request->getIsCpRequest() || $request->getToken() !== null || + $request->getIsPreview() || ($request->getIsActionRequest() && !($request->getIsLoginRequest() && $request->getIsGet())) ) { $headers->set('X-Robots-Tag', 'none'); From 5855b79f74040a1de6054fe54c9208f97cabc9a7 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Thu, 29 Aug 2024 11:37:29 -0700 Subject: [PATCH 2/2] Release note [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index facb46c3eb2..74891abd71b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Craft now sends `X-Robots-Tag: none` headers for preview requests. ([#15612](https://github.com/craftcms/cms/pull/15612), [#15586](https://github.com/craftcms/cms/issues/15586)) - Fixed a SQL error that occurred when running the `db/convert-charset` command if there were any custom database views or sequences. ([#15598](https://github.com/craftcms/cms/issues/15598)) - Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return `false` on databases that supported time zone conversion. ([#15592](https://github.com/craftcms/cms/issues/15592)) - Fixed a bug where Assets fields were validating settings that weren’t applicable depending on the “Restrict assets to a single location” setting. ([#15545](https://github.com/craftcms/cms/issues/15545))