Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,7 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
this.socket.cork();
}

if (chunk) {
write_(this, chunk, encoding, null, true);
} else if (this.finished) {
if (this.finished) {
if (typeof callback === 'function') {
if (!this.writableFinished) {
this.on('finish', callback);
Expand All @@ -819,6 +817,8 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) {
}
}
return this;
} else if (chunk) {
write_(this, chunk, encoding, null, true);
} else if (!this._header) {
this._contentLength = 0;
this._implicitHeader();
Expand Down