From 89f2f7d39b827ea1fbf5435d03d07d9ff1aa5a8d Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Wed, 11 Sep 2019 23:30:30 +0900 Subject: [PATCH] Make sure we try to read as soon as possible. Otherwise we may miss a chunk if timing is off. --- lib/util/streamutil.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/util/streamutil.js b/lib/util/streamutil.js index 4c6fb284..118071ac 100644 --- a/lib/util/streamutil.js +++ b/lib/util/streamutil.js @@ -36,6 +36,8 @@ module.exports.readAll = function(stream) { stream.on('readable', readableListener) stream.on('end', endListener) + readableListener() + return resolver.promise.finally(function() { stream.removeListener('error', errorListener) stream.removeListener('readable', readableListener)