diff --git a/app/controllers/robots_txt_controller.rb b/app/controllers/robots_txt_controller.rb index 0853c3efabb..0919c254bd3 100644 --- a/app/controllers/robots_txt_controller.rb +++ b/app/controllers/robots_txt_controller.rb @@ -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