@@ -176,6 +176,7 class RepositoriesController < ApplicationController | |||||
176 | send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } |
|
176 | send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) } | |
177 | send_type = Redmine::MimeType.of(@path) |
|
177 | send_type = Redmine::MimeType.of(@path) | |
178 | send_opt[:type] = send_type.to_s if send_type |
|
178 | send_opt[:type] = send_type.to_s if send_type | |
|
179 | send_opt[:disposition] = (Redmine::MimeType.is_type?('image', @path) && !is_raw ? 'inline' : 'attachment') | |||
179 | send_data @content, send_opt |
|
180 | send_data @content, send_opt | |
180 | else |
|
181 | else | |
181 | # Prevent empty lines when displaying a file with Windows style eol |
|
182 | # Prevent empty lines when displaying a file with Windows style eol |
@@ -185,6 +185,13 class RepositoriesSubversionControllerTest < ActionController::TestCase | |||||
185 | end |
|
185 | end | |
186 | end |
|
186 | end | |
187 |
|
187 | |||
|
188 | def test_entry_should_send_images_inline | |||
|
189 | get :entry, :id => PRJ_ID, | |||
|
190 | :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param] | |||
|
191 | assert_response :success | |||
|
192 | assert_equal 'inline; filename="rubylogo.gif"', response.headers['Content-Disposition'] | |||
|
193 | end | |||
|
194 | ||||
188 | def test_entry_at_given_revision |
|
195 | def test_entry_at_given_revision | |
189 | assert_equal 0, @repository.changesets.count |
|
196 | assert_equal 0, @repository.changesets.count | |
190 | @repository.fetch_changesets |
|
197 | @repository.fetch_changesets |
General Comments 0
You need to be logged in to leave comments.
Login now