summaryrefslogtreecommitdiffstats
path: root/app/controllers/repositories_controller.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-22 16:56:52 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-22 16:56:52 +0000
commitf15b12556f01be2eca445f13bed33ce463146ed6 (patch)
tree2c299c76dbaf1d3f7a57b46d120e09511a7eca7d /app/controllers/repositories_controller.rb
parentcb297048df58141f7d0f21c996603c850ae51d2e (diff)
downloadredmine-f15b12556f01be2eca445f13bed33ce463146ed6.tar.gz
redmine-f15b12556f01be2eca445f13bed33ce463146ed6.zip
scm: set mime type in downloading file.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5210 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/repositories_controller.rb')
-rw-r--r--app/controllers/repositories_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index a4719423e..475472509 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -127,7 +127,10 @@ class RepositoriesController < ApplicationController
(@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
! is_entry_text_data?(@content, @path)
# Force the download
- send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
+ send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) }
+ send_type = Redmine::MimeType.of(@path)
+ send_opt[:type] = send_type.to_s if send_type
+ send_data @content, send_opt
else
# Prevent empty lines when displaying a file with Windows style eol
# TODO: UTF-16