| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2133b18 commit ca89c37
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,7 +56,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) { | |||
| 56 | 56 | assert.strictEqual(cert.exponent, exponent); | |
| 57 | 57 | assert.strictEqual(cert.modulus, modulus); | |
| 58 | 58 | res.writeHead(200, { 'content-type': 'text/plain' }); | |
| 59 | - res.end(body); | ||
| 59 | + res.end(body, () => { console.log('stream finished'); }); | ||
| 60 | 60 | console.log('sent response'); | |
| 61 | 61 | })); | |
| 62 | 62 | ||
@@ -74,8 +74,11 @@ server.listen(0, function() { | |||
| 74 | 74 | const message = data.toString(); | |
| 75 | 75 | const contents = message.split(CRLF + CRLF).pop(); | |
| 76 | 76 | assert.strictEqual(body, contents); | |
| 77 | - server.close(); | ||
| 78 | - console.log('server closed'); | ||
| 77 | + server.close((e) => { | ||
| 78 | + assert.ifError(e); | ||
| 79 | + console.log('server closed'); | ||
| 80 | + }); | ||
| 81 | + console.log('server.close() called'); | ||
| 79 | 82 | }); | |
| 80 | 83 | ||
| 81 | 84 | client.stdin.write('GET /\n\n'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments