| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 556703d commit 34d9e48
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,9 +34,14 @@ srv.listen(common.PORT, '127.0.0.1', function() { | |||
| 34 | 34 | ||
| 35 | 35 | var req = http.get({ port: common.PORT }); | |
| 36 | 36 | req.on('upgrade', function(res, socket, upgradeHead) { | |
| 37 | - // XXX: This test isn't fantastic, as it assumes that the entire response | ||
| 38 | - // from the server will arrive in a single data callback | ||
| 39 | - assert.equal(upgradeHead, 'nurtzo'); | ||
| 37 | + var recvData = upgradeHead; | ||
| 38 | + socket.on('data', function(d) { | ||
| 39 | + recvData += d; | ||
| 40 | + }); | ||
| 41 | + | ||
| 42 | + socket.on('close', common.mustCall(function() { | ||
| 43 | + assert.equal(recvData, 'nurtzo'); | ||
| 44 | + })); | ||
| 40 | 45 | ||
| 41 | 46 | console.log(res.headers); | |
| 42 | 47 | var expectedHeaders = {'hello': 'world', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments