]> source.dussan.org Git - redmine.git/commitdiff
use relative url at robots.txt (#27865)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 29 Dec 2017 14:56:51 +0000 (14:56 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 29 Dec 2017 14:56:51 +0000 (14:56 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@17135 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/welcome/robots.text.erb
test/integration/welcome_test.rb

index 10b54093542dfaeae682ecdca97441a82056be8d..089c8e3fb9c9bcedda281c7cc297f786fc064558 100644 (file)
@@ -1,10 +1,10 @@
 User-agent: *
 <% @projects.each do |p| -%>
-Disallow: /projects/<%= p.to_param %>/repository
-Disallow: /projects/<%= p.to_param %>/issues
-Disallow: /projects/<%= p.to_param %>/activity
+Disallow: <%= url_for(:controller => 'repositories', :action => :show, :id => p) %>
+Disallow: <%= url_for(project_issues_path(:project_id => p)) %>
+Disallow: <%= url_for(project_activity_path(:id => p)) %>
 <% end -%>
-Disallow: /issues/gantt
-Disallow: /issues/calendar
-Disallow: /activity
-Disallow: /search
+Disallow: <%= url_for(issues_gantt_path) %>
+Disallow: <%= url_for(issues_calendar_path) %>
+Disallow: <%= url_for(activity_path) %>
+Disallow: <%= url_for(search_path) %>
index 12ec92d0c4ce92f406465ab45cb3ac5a77122ecb..6b370e5d462650d557925ec39eedaa135f1e4661 100644 (file)
@@ -25,6 +25,7 @@ class WelcomeTest < Redmine::IntegrationTest
     get '/robots.txt'
     assert_response :success
     assert_equal 'text/plain', @response.content_type
+    # It seems Redmine::Utils.relative_url_root does not effect on Rails 5.1.4
     assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
   end
 end