mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: add X-Robots-Tag header for check_xhr-covered GET actions, too (#9868)
* FIX: add X-Robots-Tag header for check_xhr-covered GET actions, too see https://meta.discourse.org/t/missing-x-robots-tag/152593/3 for context * test: a spec making sure X-Robots-Tag header is present when needed /groups path responds to anonymous requests and doesn't skip `check_xhr` method, so we can use it here.
This commit is contained in:
@@ -176,6 +176,12 @@ describe GroupsController do
|
||||
)
|
||||
end
|
||||
|
||||
it 'should return correct X-Robots-Tag header when allow_index_in_robots_txt is set to false' do
|
||||
SiteSetting.allow_index_in_robots_txt = false
|
||||
get "/groups"
|
||||
expect(response.headers['X-Robots-Tag']).to eq('noindex, nofollow')
|
||||
end
|
||||
|
||||
context 'viewing groups of another user' do
|
||||
describe 'when an invalid username is given' do
|
||||
it 'should return the right response' do
|
||||
|
||||
Reference in New Issue
Block a user