| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec24d37 commit 3d5bc69
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,9 +45,14 @@ srv.listen(common.PORT, '127.0.0.1', function() { | |||
| 45 | 45 | req.end(); | |
| 46 | 46 | ||
| 47 | 47 | req.on('upgrade', function(res, socket, upgradeHead) { | |
| 48 | - // XXX: This test isn't fantastic, as it assumes that the entire response | ||
| 49 | - // from the server will arrive in a single data callback | ||
| 50 | - assert.equal(upgradeHead, 'nurtzo'); | ||
| 48 | + var recvData = upgradeHead; | ||
| 49 | + socket.on('data', function(d) { | ||
| 50 | + recvData += d; | ||
| 51 | + }); | ||
| 52 | + | ||
| 53 | + socket.on('close', common.mustCall(function() { | ||
| 54 | + assert.equal(recvData, 'nurtzo'); | ||
| 55 | + })); | ||
| 51 | 56 | ||
| 52 | 57 | console.log(res.headers); | |
| 53 | 58 | var expectedHeaders = { 'hello': 'world', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments