From 37241f8a556be041520305df9b29c9c5d5ce7ccf Mon Sep 17 00:00:00 2001 From: Max Mathieu Date: Sat, 21 Sep 2024 17:31:27 -0400 Subject: [PATCH] Fix out-of-band error event from busboy --- lib/make-middleware.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/make-middleware.js b/lib/make-middleware.js index 6627cf4c..cc26414a 100644 --- a/lib/make-middleware.js +++ b/lib/make-middleware.js @@ -41,7 +41,9 @@ function makeMiddleware (setup) { if (isDone) return isDone = true req.unpipe(busboy) - busboy.removeAllListeners() + process.nextTick(() => { + busboy.removeAllListeners() + }) next(err) }