From 0730d8d32aa7cf99ac63721c6005f0f3e835ff2b Mon Sep 17 00:00:00 2001 From: Aaron Gabriel Neyer Date: Mon, 28 Nov 2022 11:32:09 -0700 Subject: [PATCH] Update busboy sample to use on('close') (#2766) * Update busboy sample to use on('close') Per this update, busboy should use on('close') rather than on('finish'). https://github.com/mscdex/busboy/issues/266 * Update busboy version Co-authored-by: Jennifer Davis Co-authored-by: Adam Ross Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> --- functions/http/package.json | 2 +- functions/http/uploadFile/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/http/package.json b/functions/http/package.json index 5fc1516aae..9947ee8043 100644 --- a/functions/http/package.json +++ b/functions/http/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@google-cloud/storage": "^6.0.0", - "busboy": "^1.0.0", + "busboy": "^1.6.0", "escape-html": "^1.0.3" } } diff --git a/functions/http/uploadFile/index.js b/functions/http/uploadFile/index.js index 51476ee734..0093024c3f 100644 --- a/functions/http/uploadFile/index.js +++ b/functions/http/uploadFile/index.js @@ -73,7 +73,7 @@ exports.uploadFile = (req, res) => { file.on('end', () => { writeStream.end(); }); - writeStream.on('finish', resolve); + writeStream.on('close', resolve); writeStream.on('error', reject); }); fileWrites.push(promise);