diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index ada5d6f66d9..51cbb5297b5 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 b4c0b866ea0..926e506e35c 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