@@ -127,7 +127,10 class RepositoriesController < ApplicationController | |||
|
127 | 127 | (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) || |
|
128 | 128 | ! is_entry_text_data?(@content, @path) |
|
129 | 129 | # Force the download |
|
130 |
send_ |
|
|
130 | send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } | |
|
131 | send_type = Redmine::MimeType.of(@path) | |
|
132 | send_opt[:type] = send_type.to_s if send_type | |
|
133 | send_data @content, send_opt | |
|
131 | 134 | else |
|
132 | 135 | # Prevent empty lines when displaying a file with Windows style eol |
|
133 | 136 | # TODO: UTF-16 |
@@ -98,8 +98,7 class RepositoriesFilesystemControllerTest < ActionController::TestCase | |||
|
98 | 98 | with_settings :file_max_size_displayed => 1 do |
|
99 | 99 | get :entry, :id => PRJ_ID, :path => ['japanese', 'big-file.txt'] |
|
100 | 100 | assert_response :success |
|
101 | # TODO: 'text/plain' | |
|
102 | assert_equal 'application/octet-stream', @response.content_type | |
|
101 | assert_equal 'text/plain', @response.content_type | |
|
103 | 102 | end |
|
104 | 103 | end |
|
105 | 104 | else |
@@ -222,8 +222,7 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||
|
222 | 222 | def test_entry_binary_force_download |
|
223 | 223 | get :entry, :id => PRJ_ID, :rev => 1, :path => ['images', 'edit.png'] |
|
224 | 224 | assert_response :success |
|
225 | # TODO: 'image/png' | |
|
226 | assert_equal 'application/octet-stream', @response.content_type | |
|
225 | assert_equal 'image/png', @response.content_type | |
|
227 | 226 | end |
|
228 | 227 | |
|
229 | 228 | def test_directory_entry |
General Comments 0
You need to be logged in to leave comments.
Login now