]> source.dussan.org Git - redmine.git/commitdiff
Fix robots.txt to disallow issue lists with a sort or query_id parameter in any posit...
authorGo MAEDA <maeda@farend.jp>
Mon, 23 Jan 2023 08:08:21 +0000 (08:08 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 23 Jan 2023 08:08:21 +0000 (08:08 +0000)
Patch by Felix Schäfer.

git-svn-id: https://svn.redmine.org/redmine/trunk@22070 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index 0eabf6cff66f8109f46a0778f0e27964879b3932..ed8c230ecb7e9cedd724530d7420bc8b8aa410fe 100644 (file)
@@ -13,8 +13,8 @@ Disallow: <%= url_for(issues_gantt_path) %>
 Disallow: <%= url_for(issues_calendar_path) %>
 Disallow: <%= url_for(activity_path) %>
 Disallow: <%= url_for(search_path) %>
-Disallow: <%= url_for(issues_path(:sort => '')) %>
-Disallow: <%= url_for(issues_path(:query_id => '')) %>
+Disallow: <%= url_for(issues_path) %>?*sort=
+Disallow: <%= url_for(issues_path) %>?*query_id=
 Disallow: <%= url_for(issues_path) %>?*set_filter=
 Disallow: <%= url_for(issues_path(:trailing_slash => true)) %>*.pdf$
 Disallow: <%= url_for(projects_path(:trailing_slash => true)) %>*.pdf$
index a27f6869ea76bf6b8a05429ba69bd106eeae8301..d1b0c888956cb0a74aac1d2181f48dbb02c55f84 100644 (file)
@@ -31,7 +31,7 @@ class WelcomeTest < Redmine::IntegrationTest
     assert_equal 'text/plain', @response.media_type
     # Redmine::Utils.relative_url_root does not effect on Rails 5.1.4.
     assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
-    assert @response.body.match(%r{^Disallow: /issues\?sort=\r?$})
+    assert @response.body.match(%r{^Disallow: /issues\?\*sort=\r?$})
     assert @response.body.match(%r{^Disallow: /issues\?\*set_filter=\r?$})
     assert @response.body.match(%r{^Disallow: /issues/\*\.pdf\$\r?$})
     assert @response.body.match(%r{^Disallow: /projects/\*\.pdf\$\r?$})