mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
http: don't cork .end when not needed
PR-URL: https://github.com/nodejs/node/pull/36633 Backport-PR-URL: https://github.com/nodejs/node/pull/36940 Fixes: https://github.com/nodejs/node/issues/36620 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
This commit is contained in:
1 parent
c03cddb46f
commit
25a3204fe2
1 file changed
+2
-1
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user