aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGervase Markham <gerv@gerv.net>2014-10-24 09:17:24 +0100
committerGervase Markham <gerv@gerv.net>2014-10-24 09:17:24 +0100
commitbd9062bb8b409de5e7759bf588c1dbd0068f6067 (patch)
treeb87890b9b3cfd4d9ce281b7eee52b5a387589c66 /attachment.cgi
parentBug 1073264 - allow attachment download to be offloaded to the webserver usin... (diff)
downloadbugzilla-bd9062bb8b409de5e7759bf588c1dbd0068f6067.tar.gz
bugzilla-bd9062bb8b409de5e7759bf588c1dbd0068f6067.tar.bz2
bugzilla-bd9062bb8b409de5e7759bf588c1dbd0068f6067.zip
Revert "Bug 1073264 - allow attachment download to be offloaded to the webserver using X-SendFile or equivalent. r=gerv, a=glob." Morning brain thought this bug was approved for 5.0.
This reverts commit 55e8faeed19ff618483cb5803847bdba6c80c752.
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi18
1 files changed, 1 insertions, 17 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 61e6f58d8..5db8f5909 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -26,7 +26,6 @@ use Bugzilla::Attachment::PatchReader;
use Bugzilla::Token;
use Encode qw(encode find_encoding);
-use Cwd qw(realpath);
# For most scripts we don't make $cgi and $template global variables. But
# when preparing Bugzilla for mod_perl, this script used these
@@ -362,24 +361,9 @@ sub view {
}
}
}
- my $sendfile_header = {};
- my $sendfile_param = Bugzilla->params->{'xsendfile_header'};
- if ($attachment->is_on_filesystem && $sendfile_param ne 'off') {
- # attachment is on filesystem and Admin turned on feature.
- # This means we can let webserver handle the request and stream the file
- # for us. This is called the X-Sendfile feature. see bug 1073264.
- my $attachment_path = realpath($attachment->_get_local_filename());
- $sendfile_header->{$sendfile_param} = $attachment_path;
- }
print $cgi->header(-type=>"$contenttype; name=\"$filename\"",
-content_disposition=> "$disposition; filename=\"$filename\"",
- -content_length => $attachment->datasize,
- %$sendfile_header);
- if ($attachment->is_on_filesystem && $sendfile_param ne 'off') {
- # in case of X-Sendfile, we do not print the data.
- # that is handled directly by the webserver.
- return;
- }
+ -content_length => $attachment->datasize);
disable_utf8();
print $attachment->data;
}