| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d87303 commit 70ed4ef
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -878,9 +878,10 @@ OutgoingMessage.prototype.end = function end(chunk, encoding, callback) { | |||
| 878 | 878 | ||
| 879 | 879 | if (this._hasBody && this.chunkedEncoding) { | |
| 880 | 880 | this._send('0\r\n' + this._trailer + '\r\n', 'latin1', finish); | |
| 881 | - } else { | ||
| 882 | - // Force a flush, HACK. | ||
| 881 | + } else if (!this._headerSent || this.writableLength || chunk) { | ||
| 883 | 882 | this._send('', 'latin1', finish); | |
| 883 | + } else { | ||
| 884 | + process.nextTick(finish); | ||
| 884 | 885 | } | |
| 885 | 886 | ||
| 886 | 887 | if (this.socket) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,11 +42,11 @@ Connection: close | |||
| 42 | 42 | // parser.finish() to be called while we are here in the 'continue' | |
| 43 | 43 | // callback, which is inside a parser.execute() call. | |
| 44 | 44 | ||
| 45 | - assert.strictEqual(chunk.length, 0); | ||
| 45 | + assert.strictEqual(chunk.length, 4); | ||
| 46 | 46 | clientSide.destroy(new Error('sometimes the code just doesn’t work'), cb); | |
| 47 | 47 | }); | |
| 48 | 48 | req.on('error', common.mustCall()); | |
| 49 | - req.end(); | ||
| 49 | + req.end('data'); | ||
| 50 | 50 | ||
| 51 | 51 | sync = false; | |
| 52 | 52 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments