fix scope error
This commit is contained in:
parent
edd5651e0e
commit
ecf44e0c68
|
@ -267,9 +267,8 @@ exports.download = function(provider, req, res, container, file, cb) {
|
||||||
cb = function() {}; // avoid double-callback
|
cb = function() {}; // avoid double-callback
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
function setupPartialDownload(params, stats, res) {
|
function setupPartialDownload(params, stats, res) {
|
||||||
var total = stats.size;
|
var total = stats.size;
|
||||||
|
|
||||||
var parts = range.replace(/bytes=/, '').split('-');
|
var parts = range.replace(/bytes=/, '').split('-');
|
||||||
|
@ -285,8 +284,10 @@ function setupPartialDownload(params, stats, res) {
|
||||||
res.set('Content-Range', 'bytes ' + params.start + '-' + params.end + '/' + total);
|
res.set('Content-Range', 'bytes ' + params.start + '-' + params.end + '/' + total);
|
||||||
res.set('Accept-Ranges', 'bytes');
|
res.set('Accept-Ranges', 'bytes');
|
||||||
res.set('Content-Length', chunksize);
|
res.set('Content-Length', chunksize);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function processError(err, fileName) {
|
function processError(err, fileName) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
err.statusCode = err.status = 404;
|
err.statusCode = err.status = 404;
|
||||||
|
|
Loading…
Reference in New Issue