Invalid busboy behavior on incomplete multipart
See original GitHub issueWith busboy 0.2.9 when piping an incomplete multipart to busboy
the last (incomplete) part is emitted on source end (field emitted, or file stream end emitted), then busboy stops emitting events (no file end
, no finish
, no error
).
It should instead emit an error: the multipart is invalid (because incomplete) and should not emit the current part, because it’s not finished.
head commit e70d9e462b21f5554c54aa16bc20620e5f5e3eff fixes part of this issue: now busboy emits an error (Error: Unexpected end of multipart data
), but the current incomplete part is still emitted.
For field events we should just not emit them and emit error
on busboy.
For file events we should emit error
on file, on busboy or on both, I’m not sure which.
Busboy also emits finish
, I’m not sure if we want that in addition to the error
event.
I’m not sure how to properly handle errors in a pipe involving multiple streams (in my case: http request incoming message, busboy, aws-sdk S3 upload; the S3 upload needs an explicit abort on source error, and the http request needs a reply): busboy readme doesn’t show any error handling example.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top GitHub Comments
@tomasdev Sorry I don’t remember, it was too long ago, I stopped using node.js since.
Closing this for now with the new implementation in master and with changes to node streams in general in modern versions of node.
'close'
is now the event to listen for whether there was an error or not and'finish'
should only be emitted if there was no error.