mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 11:13:22 +08:00
FIX: robots.txt should be accessible even when login is required
This commit is contained in:
parent
de344bcd7e
commit
d75cc67d86
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user