Skip to content
Browse files

Call the callback with an error if the request is aborted.

The callback should always get called no matter what, to not do so breaks assumptions that hold for most other node libraries.
  • Loading branch information...
1 parent f6ae2a8 commit 21ab5fa420d27c71d2841d98787ac700bae07745 @almost committed Apr 30, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/incoming_form.js
View
3 lib/incoming_form.js
@@ -115,6 +115,9 @@ IncomingForm.prototype.parse = function(req, cb) {
})
.on('end', function() {
cb(null, fields, files);
+ })
+ .on('aborted', function () {
+ cb(new Error('Request aborted'), fields, files);
});
}

0 comments on commit 21ab5fa

Please sign in to comment.
Something went wrong with that request. Please try again.