From d75cc67d86c3f5042a939bc19a75e6258fc87657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 15 Oct 2015 11:42:41 +0200 Subject: [PATCH] FIX: robots.txt should be accessible even when login is required --- app/controllers/robots_txt_controller.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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