apps: clear timeout for upload and download routes

This commit is contained in:
Girish Ramakrishnan
2021-10-21 10:44:17 -07:00
parent e0edfbf621
commit fbaee89c7b

View File

@@ -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));