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:
Sam Saffron 2020-02-28 09:20:36 +11:00
parent f358114361
commit 8e5edae093
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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}