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
|
end
|
||||||
|
|
||||||
def add_noindex_header
|
def add_noindex_header
|
||||||
response.headers['X-Robots-Tag'] = 'noindex'
|
response.headers['X-Robots-Tag'] = 'noindex' if request.get?
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
class SearchController < ApplicationController
|
class SearchController < ApplicationController
|
||||||
|
|
||||||
skip_before_action :check_xhr, only: :show
|
|
||||||
|
|
||||||
before_action :cancel_overloaded_search, only: [:query]
|
before_action :cancel_overloaded_search, only: [:query]
|
||||||
|
skip_before_action :check_xhr, only: :show
|
||||||
|
after_action :add_noindex_header
|
||||||
|
|
||||||
def self.valid_context_types
|
def self.valid_context_types
|
||||||
%w{user topic category private_messages tag}
|
%w{user topic category private_messages tag}
|
||||||
|
|
Loading…
Reference in New Issue