Open yjinchoi opened 1 year ago
Probably duplicate of #49
I don't think the issue is with async-busboy, but instead Koa.
NodeJS http library is closing the request when I would expect it not to. The issue here is, I think, figuring out why http is issuing the close event, when we are in the depths of our application code 🤔
Sometimes I found that asyncBusboy not responding because promise never resolved or rejected. I traced inside asyncBusBoy source code and I found that sometimes request's 'close' event handler called before busboy's 'finish' handler ( before onEnd called). I modified source code like "request.on('close', onEnd)" instead of "request.on('close', cleanup)" and it works perfectly. I'm afraid I'm doing wrong and make some side effects. Replacing handler to onEnd instead of cleanup is safe?