diff --git a/config/routes.rb b/config/routes.rb
index 540f3d0af..f5b73d96c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -405,7 +405,7 @@ Rails.application.routes.draw do
 
   match 'uploads', :to => 'attachments#upload', :via => :post
 
-  get 'robots', :to => 'welcome#robots'
+  get 'robots', :to => 'welcome#robots', :defaults => { format: 'txt' }
 
   Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path|
     instance_eval(plugin_routes_path.read, plugin_routes_path.to_s)
diff --git a/test/integration/routing/welcome_test.rb b/test/integration/routing/welcome_test.rb
index c46784766..f9dce261a 100644
--- a/test/integration/routing/welcome_test.rb
+++ b/test/integration/routing/welcome_test.rb
@@ -22,6 +22,6 @@ require_relative '../../test_helper'
 class RoutingWelcomeTest < Redmine::RoutingTest
   def test_welcome
     should_route 'GET /' => 'welcome#index'
-    should_route 'GET /robots.txt' => 'welcome#robots', :format => 'txt'
+    should_route 'GET /robots' => 'welcome#robots', :format => 'txt'
   end
 end
diff --git a/test/integration/welcome_test.rb b/test/integration/welcome_test.rb
index d1b0c8889..d9047dcde 100644
--- a/test/integration/welcome_test.rb
+++ b/test/integration/welcome_test.rb
@@ -43,6 +43,12 @@ class WelcomeTest < Redmine::IntegrationTest
     assert @response.body.match(%r{^Disallow: /projects/subproject1/issues\r?$})
   end
 
+  def test_robots_when_no_format_is_given
+    get '/robots'
+    assert_response :success
+    assert_equal 'text/plain', @response.media_type
+  end
+
   def test_robots_when_login_is_required
     with_settings :login_required => '1' do
       get '/robots.txt'
