From 4cb4d450be9c66408344b7176b9cb600d8a044b1 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Mon, 30 Mar 2020 15:03:09 +0100 Subject: [PATCH] Call end() when handing ERR_STREAM_PREMATURE_CLOSE --- services/filestore/app/js/FileController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/filestore/app/js/FileController.js b/services/filestore/app/js/FileController.js index 0e663f9421..e39afd67bb 100644 --- a/services/filestore/app/js/FileController.js +++ b/services/filestore/app/js/FileController.js @@ -61,7 +61,9 @@ function getFile(req, res, next) { } pipeline(fileStream, res, err => { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { + if (err && err.code === 'ERR_STREAM_PREMATURE_CLOSE') { + res.end() + } else if (err) { next( new Errors.ReadError({ message: 'error transferring stream',