FIX: robots.txt should be accessible even when login is required

This commit is contained in:
Régis Hanol 2015-10-15 11:42:41 +02:00
parent de344bcd7e
commit d75cc67d86

View File

@ -1,14 +1,9 @@
class RobotsTxtController < ApplicationController class RobotsTxtController < ApplicationController
layout false layout false
skip_before_filter :preload_json, :check_xhr skip_before_filter :preload_json, :check_xhr, :redirect_to_login_if_required
def index def index
path = if SiteSetting.allow_index_in_robots_txt path = SiteSetting.allow_index_in_robots_txt ? :index : :no_index
:index
else
:no_index
end
render path, content_type: 'text/plain' render path, content_type: 'text/plain'
end end
end end