Skip to content

Commit

Permalink
http: don't cork .end when not needed
Browse files Browse the repository at this point in the history
PR-URL: #36633
Backport-PR-URL: #36940
Fixes: #36620
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Danielle Adams <[email protected]>
  • Loading branch information
mitsos1os authored and BethGriggs committed Jan 26, 2021
1 parent f002f23 commit 5593187
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
encoding = null;
}

if (this.socket) {
// Not finished, socket exists and data will be written (chunk or header)
if (this.socket && !this.finished && (chunk || !this._header)) {
this.socket.cork();
}

Expand Down

0 comments on commit 5593187

Please sign in to comment.