summaryrefslogtreecommitdiffstats
path: root/config/routes.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-05-30 12:49:07 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-05-30 12:49:07 +0000
commitf76a85dc5a92a5290659e3d6a36ecd630c740ba3 (patch)
tree7537d188605b5d599944da79858a4946bdf9544f /config/routes.rb
parent7aa642ad7acbf40083b4e870acf8aa71d27eb0e9 (diff)
downloadredmine-f76a85dc5a92a5290659e3d6a36ecd630c740ba3.tar.gz
redmine-f76a85dc5a92a5290659e3d6a36ecd630c740ba3.zip
scm: fix error when *.yml and *.txt show (#31141, #30850)
Contributed by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18211 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb
index a072222e2..5ac2575c3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -250,22 +250,31 @@ Rails.application.routes.draw do
post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
- %w(browse show entry raw annotate diff).each do |action|
+ %w(browse show entry raw annotate).each do |action|
get "projects/:id/repository/:repository_id/revisions/:rev/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false,
+ :format => 'html',
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
end
- %w(browse entry raw changes annotate diff).each do |action|
+ %w(browse entry raw changes annotate).each do |action|
get "projects/:id/repository/:repository_id/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false,
+ :format => 'html',
:constraints => {:path => /.*/}
end
+ get "projects/:id/repository/:repository_id/revisions/:rev/diff(/*path)",
+ :to => 'repositories#diff',
+ :format => false,
+ :constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
+ get "projects/:id/repository/:repository_id/diff(/*path)",
+ :to => 'repositories#diff',
+ :format => false,
+ :constraints => {:path => /.*/}
+
get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/}
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil