apps: clear timeout for upload and download routes
This commit is contained in:
@@ -789,6 +789,8 @@ function uploadFile(req, res, next) {
|
||||
if (typeof req.query.file !== 'string' || !req.query.file) return next(new HttpError(400, 'file query argument must be provided'));
|
||||
if (!req.files.file) return next(new HttpError(400, 'file must be provided as multipart'));
|
||||
|
||||
req.clearTimeout();
|
||||
|
||||
apps.uploadFile(req.app, req.files.file.path, req.query.file, function (error) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
@@ -801,6 +803,8 @@ function downloadFile(req, res, next) {
|
||||
|
||||
if (typeof req.query.file !== 'string' || !req.query.file) return next(new HttpError(400, 'file query argument must be provided'));
|
||||
|
||||
req.clearTimeout();
|
||||
|
||||
apps.downloadFile(req.app, req.query.file, function (error, stream, info) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user