Explorar o código

Call end() when handing ERR_STREAM_PREMATURE_CLOSE

Simon Detheridge %!s(int64=6) %!d(string=hai) anos
pai
achega
4cb4d450be
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      services/filestore/app/js/FileController.js

+ 3 - 1
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',