FIX: add noindex header to user summary page.
This commit is contained in:
parent
24b3996f45
commit
4f4d8d683f
|
@ -349,6 +349,8 @@ class UsersController < ApplicationController
|
|||
@user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
raise Discourse::NotFound unless guardian.can_see_profile?(@user)
|
||||
|
||||
response.headers['X-Robots-Tag'] = 'noindex'
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
@restrict_fields = guardian.restrict_user_fields?(@user)
|
||||
|
|
|
@ -2816,6 +2816,7 @@ describe UsersController do
|
|||
create_post(user: user)
|
||||
|
||||
get "/u/#{user.username_lower}/summary.json"
|
||||
expect(response.headers['X-Robots-Tag']).to eq('noindex')
|
||||
expect(response.status).to eq(200)
|
||||
json = response.parsed_body
|
||||
|
||||
|
|
Loading…
Reference in New Issue