]> source.dussan.org Git - redmine.git/commitdiff
robots.txt: disallow crawling dynamically generated PDF documents (#31617).
authorGo MAEDA <maeda@farend.jp>
Thu, 9 Jul 2020 00:33:41 +0000 (00:33 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 9 Jul 2020 00:33:41 +0000 (00:33 +0000)
Patch by Go MAEDA.

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

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

index 16acc8111582cc45fa8cc3375c99f511412f5e06..7516fea5de4051b4005376b4a9ae922067d32776 100644 (file)
@@ -13,3 +13,5 @@ Disallow: <%= url_for(search_path) %>
 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 e28e97ba5f4ed9ac6c0b5c017d4874c1ff3e3202..a526a8cec6e2f22baf7883b2a36d359d294dae84 100644 (file)
@@ -31,5 +31,7 @@ class WelcomeTest < Redmine::IntegrationTest
     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\?\*set_filter=\r?$})
+    assert @response.body.match(%r{^Disallow: /issues/\*\.pdf\$\r?$})
+    assert @response.body.match(%r{^Disallow: /projects/\*\.pdf\$\r?$})
   end
 end