Merged r16114 (#24646).

git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16130 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-01-04 19:52:47 +00:00
parent 7ec2c27385
commit 82a67f4ebe
2 changed files with 13 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ module RedmineApp
config.middleware.insert_after ActionDispatch::ParamsParser, ActionDispatch::XmlParamsParser
# Sets the Content-Length header on responses with fixed-length bodies
config.middleware.use Rack::ContentLength
config.middleware.insert_after Rack::Sendfile, Rack::ContentLength
# Verify validity of user sessions
config.redmine_verify_sessions = true

View File

@@ -136,6 +136,18 @@ class AttachmentsTest < Redmine::IntegrationTest
assert_include "$('#attachments_1').remove();", response.body
end
def test_download_should_set_sendfile_header
set_fixtures_attachments_directory
Rack::Sendfile.any_instance.stubs(:variation).returns("X-Sendfile")
get "/attachments/download/4"
assert_response :success
assert_not_nil response.headers["X-Sendfile"]
ensure
set_tmp_attachments_directory
end
private
def ajax_upload(filename, content, attachment_id=1)