From b7060be18ddc8e48d65c5909338662df5b0ec9bb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Jun 2020 13:50:30 +0200 Subject: Fix robots "noindex, nofollow" signals Signed-off-by: Joas Schilling --- lib/public/AppFramework/Http/Response.php | 1 + lib/public/AppFramework/Http/TemplateResponse.php | 1 + 2 files changed, 2 insertions(+) (limited to 'lib/public/AppFramework/Http') diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 832e0b96247..c26ea4ce400 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -239,6 +239,7 @@ class Response { $this->headers['Content-Security-Policy'] = $this->getContentSecurityPolicy()->buildPolicy(); $this->headers['Feature-Policy'] = $this->getFeaturePolicy()->buildPolicy(); + $this->headers['X-Robots-Tag'] = 'none'; if ($this->ETag) { $mergeWith['ETag'] = '"' . $this->ETag . '"'; diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index d6c4006433c..bc86c153b75 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -157,6 +157,7 @@ class TemplateResponse extends Response { // \OCP\Template needs an empty string instead of 'blank' for an unwrapped response $renderAs = $this->renderAs === 'blank' ? '' : $this->renderAs; + \OCP\Util::addHeader('meta', ['name' => 'robots', 'content' => 'noindex, nofollow']); $template = new \OCP\Template($this->appName, $this->templateName, $renderAs); foreach ($this->params as $key => $value) { -- cgit v1.2.3