mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
FEATURE: unconditionally skip indexing on search controller
There are absolutely no actions in search that need indexing Also no point adding this header on non get requests
This commit is contained in:
parent
f358114361
commit
8e5edae093
|
@ -807,7 +807,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def add_noindex_header
|
||||
response.headers['X-Robots-Tag'] = 'noindex'
|
||||
response.headers['X-Robots-Tag'] = 'noindex' if request.get?
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
class SearchController < ApplicationController
|
||||
|
||||
skip_before_action :check_xhr, only: :show
|
||||
|
||||
before_action :cancel_overloaded_search, only: [:query]
|
||||
skip_before_action :check_xhr, only: :show
|
||||
after_action :add_noindex_header
|
||||
|
||||
def self.valid_context_types
|
||||
%w{user topic category private_messages tag}
|
||||
|
|
Loading…
Reference in New Issue
Block a user