Skip to content

Commit

Permalink
listen for errors earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
GrosSacASac committed Dec 26, 2019
1 parent e9f226d commit 3f392e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/incoming_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,17 @@ IncomingForm.prototype.parse = function(req, cb) {
this._parser.end();
});

this._parser.once('error', (error) => {
this._error(error);
});

return this;
};

IncomingForm.prototype.writeHeaders = function(headers) {
this.headers = headers;
this._parseContentLength();
this._parseContentType();
this._parser.once('error', (error) => {
this._error(error);
});
};

IncomingForm.prototype.write = function(buffer) {
Expand Down

0 comments on commit 3f392e1

Please sign in to comment.