summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 12:45:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-31 12:45:36 +0000
commitaef4a8a65bd690389dda2d2832e5a0c645b6d053 (patch)
treeefe62a1f5264b6831f63a0e5b0915f7c242207fb /test
parentd521e49dbd3c48773c5e29abba6d325fbb5142c6 (diff)
downloadredmine-aef4a8a65bd690389dda2d2832e5a0c645b6d053.tar.gz
redmine-aef4a8a65bd690389dda2d2832e5a0c645b6d053.zip
Fixed that X-Sendfile header is never set (#24646).
git-svn-id: http://svn.redmine.org/redmine/trunk@16114 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/attachments_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/integration/attachments_test.rb b/test/integration/attachments_test.rb
index 114e47a3a..ec7626953 100644
--- a/test/integration/attachments_test.rb
+++ b/test/integration/attachments_test.rb
@@ -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)