From 30b547eecea8a2fdb77a59024ceaf2ff9e373813 Mon Sep 17 00:00:00 2001 From: Damiano Viscardi Date: Tue, 19 Feb 2019 15:42:42 +0100 Subject: [PATCH] Update index.js Fixed callback on store function --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 7ea50cd..4b26c26 100644 --- a/index.js +++ b/index.js @@ -81,6 +81,10 @@ Connection.prototype.store = function(file, collection /* , targetName, callback res.on("error", function(e) { callback(e); }); + res.on("data", function(data) { + // Nothing to do here + // This event is needed otherwise on("end") is never called + }); }); is.on("data", function(data) { req.write(data);