| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce4636e commit 732a98e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - require('../common'); | ||
| 23 | + const common = require('../common'); | ||
| 24 | 24 | const assert = require('assert'); | |
| 25 | 25 | ||
| 26 | 26 | const http = require('http'); | |
@@ -56,6 +56,14 @@ server.listen(0, function() { | |||
| 56 | 56 | res.setEncoding('ascii'); | |
| 57 | 57 | res.on('data', function(chunk) { | |
| 58 | 58 | response += chunk; | |
| 59 | + if (response === 'beep boop\n') { | ||
| 60 | + setTimeout(function() { | ||
| 61 | + // The socket should be closed immediately, with no keep-alive, because | ||
| 62 | + // no content-length or transfer-encoding are used: | ||
| 63 | + assert.strictEqual(res.socket.closed, true); | ||
| 64 | + server.close(); | ||
| 65 | + }, common.platformTimeout(15)); | ||
| 66 | + } | ||
| 59 | 67 | }); | |
| 60 | 68 | }); | |
| 61 | 69 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments