]> Raphaël G. Git Repositories - packbundle/commitdiff
Prevent robot from indexing maps
authorRaphaël Gertz <git@rapsys.eu>
Thu, 13 Oct 2022 12:08:03 +0000 (14:08 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 13 Oct 2022 12:08:03 +0000 (14:08 +0200)
Controller/MapController.php

index 730fb7270103aeccb4b96380e7d91a99066c00d8..6ebb8102db9c94e2ab8b7c807d372b0f6d91e587 100644 (file)
@@ -294,6 +294,9 @@ class MapController extends AbstractController implements ServiceSubscriberInter
                //Set last modified
                $response->setLastModified(\DateTime::createFromFormat('U', strval($mtime)));
 
                //Set last modified
                $response->setLastModified(\DateTime::createFromFormat('U', strval($mtime)));
 
+               //Disable robot index
+               $response->headers->set('X-Robots-Tag', 'noindex');
+
                //Set as public
                $response->setPublic();
 
                //Set as public
                $response->setPublic();
 
@@ -539,6 +542,9 @@ class MapController extends AbstractController implements ServiceSubscriberInter
                //Set last modified
                $response->setLastModified(\DateTime::createFromFormat('U', strval($mtime)));
 
                //Set last modified
                $response->setLastModified(\DateTime::createFromFormat('U', strval($mtime)));
 
+               //Disable robot index
+               $response->headers->set('X-Robots-Tag', 'noindex');
+
                //Set as public
                $response->setPublic();
 
                //Set as public
                $response->setPublic();