| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ac7ef31 commit ff92b40
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -548,6 +548,10 @@ function _storeHeader(firstLine, headers) { | |||
| 548 | 548 | // Transfer-Encoding are removed by the user. | |
| 549 | 549 | // See: test/parallel/test-http-remove-header-stays-removed.js | |
| 550 | 550 | debug('Both Content-Length and Transfer-Encoding are removed'); | |
| 551 | + | ||
| 552 | + // We can't keep alive in this case, because with no header info the body | ||
| 553 | + // is defined as all data until the connection is closed. | ||
| 554 | + this._last = true; | ||
| 551 | 555 | } | |
| 552 | 556 | } | |
| 553 | 557 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,8 +37,6 @@ const server = http.createServer(function(request, response) { | |||
| 37 | 37 | response.setHeader('date', 'coffee o clock'); | |
| 38 | 38 | ||
| 39 | 39 | response.end('beep boop\n'); | |
| 40 | - | ||
| 41 | - this.close(); | ||
| 42 | 40 | }); | |
| 43 | 41 | ||
| 44 | 42 | let response = ''; | |
@@ -57,5 +55,12 @@ server.listen(0, function() { | |||
| 57 | 55 | res.on('data', function(chunk) { | |
| 58 | 56 | response += chunk; | |
| 59 | 57 | }); | |
| 58 | + | ||
| 59 | + setTimeout(function() { | ||
| 60 | + // The socket should be closed immediately, with no keep-alive, because | ||
| 61 | + // no content-length or transfer-encoding are used: | ||
| 62 | + assert.strictEqual(res.socket.closed, true); | ||
| 63 | + server.close(); | ||
| 64 | + }, 10); | ||
| 60 | 65 | }); | |
| 61 | 66 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments