discourse/app/controllers/robots_txt_controller.rb
Sam e5888cf090 PERF: avoid preloading json in cases where it is not needed
(uploads / avatars / non GET requests)
2015-05-20 17:12:16 +10:00

15 lines
278 B
Ruby

class RobotsTxtController < ApplicationController
layout false
skip_before_filter :preload_json, :check_xhr
def index
path = if SiteSetting.allow_index_in_robots_txt
:index
else
:no_index
end
render path, content_type: 'text/plain'
end
end