Project

General

Profile

Defect #40208 » 40208-v2.patch

Go MAEDA, 2024-02-08 13:08

View differences:

config/routes.rb
405 405

  
406 406
  match 'uploads', :to => 'attachments#upload', :via => :post
407 407

  
408
  get 'robots', :to => 'welcome#robots'
408
  get 'robots.:format', :to => 'welcome#robots', :constraints => {format: 'txt'}
409 409

  
410 410
  Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path|
411 411
    instance_eval(plugin_routes_path.read, plugin_routes_path.to_s)
test/integration/welcome_test.rb
54 54
      assert @response.body.match(%r{^Disallow: /\r?$})
55 55
    end
56 56
  end
57

  
58
  def test_robots_should_not_respond_to_unsupported_formats
59
    %w(robots.json robots).each do |file|
60
      get "/#{file}"
61
      assert_response :not_found
62
    end
63
  end
57 64
end
(2-2/2)