mirror of
https://github.com/redmine/redmine.git
synced 2025-11-09 14:56:01 +01:00
Always allow access to /robots.txt for Anonymous (#37807).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@21939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
self.main_menu = false
|
self.main_menu = false
|
||||||
|
|
||||||
|
skip_before_action :check_if_login_required, only: [:robots]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@news = News.latest User.current
|
@news = News.latest User.current
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -42,4 +42,12 @@ class WelcomeTest < Redmine::IntegrationTest
|
|||||||
# closed projects are included in the list
|
# closed projects are included in the list
|
||||||
assert @response.body.match(%r{^Disallow: /projects/subproject1/issues\r?$})
|
assert @response.body.match(%r{^Disallow: /projects/subproject1/issues\r?$})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_robots_when_login_is_required
|
||||||
|
with_settings :login_required => '1' do
|
||||||
|
get '/robots.txt'
|
||||||
|
assert_response :success
|
||||||
|
assert_equal 'text/plain', @response.media_type
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user