Skip to content

Commit

Permalink
Call the callback with an error if the request is aborted.
Browse files Browse the repository at this point in the history
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
almost committed Apr 30, 2012
1 parent f6ae2a8 commit 21ab5fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/incoming_form.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ IncomingForm.prototype.parse = function(req, cb) {
}) })
.on('end', function() { .on('end', function() {
cb(null, fields, files); cb(null, fields, files);
})
.on('aborted', function () {
cb(new Error('Request aborted'), fields, files);
}); });
} }


Expand Down

0 comments on commit 21ab5fa

Please sign in to comment.