mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 18:03:38 +08:00
FEATURE: add noindex header to tags pages (#9748)
This commit is contained in:
parent
9bce91f59f
commit
c94e6a9a66
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user