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
1 changed files with 2 additions and 7 deletions

View File

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