The multipart parser
(https://github.com/mcavage/node-restify/blob/master/lib/plugins/multipart_parser.js) uses formidable currently. Formidable creates tempfiles for each file upload, and never clears those. Even with a tmpreaper in place, this can be exploited for a DOS by sending requests with a lot of file uploads in a short time.
https://github.com/mscdex/busboy looks like a promising alternative to formidable. It supports streaming and dropping file uploads. The interface for streaming would need to be worked out- maybe by passing in something like req.form?
Any word on this? I'm looking to use multipart streaming to allow uploading a file to AWS S3 through the API.
+1 for file streaming support :)
Is this ever likely to happen?
FWIW, we have been using https://github.com/mscdex/busboy in other non-restify projects at Wikimedia since, and is has worked well for us (apart from some bugs early on).
馃憤
I can't bear formidable as well. Busboy seems stable at least for me.
If anyone is interested, we would welcome a PR to the plugins repository to either change the implementation or swap out the module that it uses.
Some of us do contribute. However, I don't think a simple PR can provide this feature unless there is some refactoring effort along with unit tests. I see the following issues with the current design.
return (false) and return next() as well as return (object)Given the popularity of this framework there should be some kind of agreement regards to the changes even before someone could invest their time for a PR.
@prabhu All of those suggestions sound great - feel free to kick off a discussion in the plugins repo, as plugin development has stopped in the main repo here.
Most helpful comment
Some of us do contribute. However, I don't think a simple PR can provide this feature unless there is some refactoring effort along with unit tests. I see the following issues with the current design.
return (false) and return next() as well as return (object)Given the popularity of this framework there should be some kind of agreement regards to the changes even before someone could invest their time for a PR.