summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-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