FEATURE: add noindex header to tags pages (#9748)

FEATURE: add noindex header to tags pages (#9748)

diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index ada5d6f..51cbb52 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -24,6 +24,8 @@ class TagsController < ::ApplicationController
 
   before_action :fetch_tag, only: [:info, :create_synonyms, :destroy_synonym]
 
+  after_action :add_noindex_header
+
   def index
     @description_meta = I18n.t("tags.title")
     @title = @description_meta
diff --git a/spec/requests/tags_controller_spec.rb b/spec/requests/tags_controller_spec.rb
index b4c0b86..926e506 100644
--- a/spec/requests/tags_controller_spec.rb
+++ b/spec/requests/tags_controller_spec.rb
@@ -29,6 +29,7 @@ describe TagsController do
         tags = response.parsed_body["tags"]
         expect(tags.length).to eq(1)
         expect(tags[0]['text']).to eq("topic-test")
+        expect(response.headers['X-Robots-Tag']).to eq('noindex')
       end
     end
 

GitHub sha: c94e6a9a

This commit appears in #9748 which was approved by eviltrout. It was merged by jomaxro.