Skip to content

Commit 25a3204

Browse files
mitsos1osBethGriggs
authored andcommitted
http: don't cork .end when not needed
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]>
1 parent c03cddb commit 25a3204

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/_http_outgoing.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,8 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
775775
encoding = null;
776776
}
777777

778-
if (this.socket) {
778+
// Not finished, socket exists and data will be written (chunk or header)
779+
if (this.socket && !this.finished && (chunk || !this._header)) {
779780
this.socket.cork();
780781
}
781782

0 commit comments

Comments
 (0)