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_opt[:disposition] = (Redmine::MimeType.is_type?('image', @path) && !is_raw ? 'inline' : 'attachment')
send_data @content, send_opt
else
# Prevent empty lines when displaying a file with Windows style eol
end
end
+ def test_entry_should_send_images_inline
+ get :entry, :id => PRJ_ID,
+ :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param]
+ assert_response :success
+ assert_equal 'inline; filename="rubylogo.gif"', response.headers['Content-Disposition']
+ end
+
def test_entry_at_given_revision
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets