Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag authored and RaisinTen committed Jul 4, 2021
1 parent 5757472 commit e178f04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ function onSocketNT(req, socket, err) {
socket.emit('free');
} else {
finished(socket.destroy(err || req[kError]), (er) => {
if (er.code === 'ERR_STREAM_PREMATURE_CLOSE') {
if (er?.code === 'ERR_STREAM_PREMATURE_CLOSE') {
er = null;
}
_destroy(req, er || err);
Expand Down
2 changes: 1 addition & 1 deletion lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
if (this.socket && !this.socket.destroyed && this.aborted) {
this.socket.destroy(err);
const cleanup = finished(this.socket, (e) => {
if (e.code === 'ERR_STREAM_PREMATURE_CLOSE') {
if (e?.code === 'ERR_STREAM_PREMATURE_CLOSE') {
e = null;
}
cleanup();
Expand Down

0 comments on commit e178f04

Please sign in to comment.