@@ -55,7 +55,7 module RedmineApp | |||
|
55 | 55 | config.middleware.insert_after ActionDispatch::ParamsParser, ActionDispatch::XmlParamsParser |
|
56 | 56 | |
|
57 | 57 | # Sets the Content-Length header on responses with fixed-length bodies |
|
58 |
config.middleware. |
|
|
58 | config.middleware.insert_after Rack::Sendfile, Rack::ContentLength | |
|
59 | 59 | |
|
60 | 60 | # Verify validity of user sessions |
|
61 | 61 | config.redmine_verify_sessions = true |
@@ -136,6 +136,18 class AttachmentsTest < Redmine::IntegrationTest | |||
|
136 | 136 | assert_include "$('#attachments_1').remove();", response.body |
|
137 | 137 | end |
|
138 | 138 | |
|
139 | def test_download_should_set_sendfile_header | |
|
140 | set_fixtures_attachments_directory | |
|
141 | Rack::Sendfile.any_instance.stubs(:variation).returns("X-Sendfile") | |
|
142 | ||
|
143 | get "/attachments/download/4" | |
|
144 | assert_response :success | |
|
145 | assert_not_nil response.headers["X-Sendfile"] | |
|
146 | ||
|
147 | ensure | |
|
148 | set_tmp_attachments_directory | |
|
149 | end | |
|
150 | ||
|
139 | 151 | private |
|
140 | 152 | |
|
141 | 153 | def ajax_upload(filename, content, attachment_id=1) |
General Comments 0
You need to be logged in to leave comments.
Login now