diff --git a/app/src/middleware/upload.js b/app/src/middleware/upload.js index 4901ccc9..12318349 100644 --- a/app/src/middleware/upload.js +++ b/app/src/middleware/upload.js @@ -13,6 +13,9 @@ const currentUpload = (strict = false) => { return (req, res, next) => { // Check Content-Length Header const contentLength = parseInt(req.get('Content-Length')); + // set a longer request timeout for large file uploads + // req.socket.server.requestTimeout = Math.max(300000, contentLength); + req.setTimeout(Math.max(300000, contentLength)); // TODO: Figure out what's killing and returning a 400 in response stack if (!contentLength) return new Problem(411, { detail: 'Content-Length must be greater than 0' }).send(res);