Merge pull request #9368 from acchou/9362

end() is the official way to release a Writable stream
This commit is contained in:
Jonas Jenwald 2018-01-17 12:45:23 +01:00 committed by GitHub
commit f774abc8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ function downloadFile(file, url, callback, redirects) {
});
response.pipe(stream);
stream.on('finish', function() {
stream.close();
stream.end();
if (!completed) {
completed = true;
callback();