| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| 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'); | |
@@ -53,15 +53,13 @@ server.on('checkContinue', (req, res) => { | |||
| 53 | 53 | res.writeContinue(() => { | |
| 54 | 54 | // Continue has been written | |
| 55 | 55 | req.on('end', () => { | |
| 56 | - res.write('asdf', (er) => { | ||
| 57 | - assert.ifError(er); | ||
| 58 | - res.write('foo', 'ascii', (er) => { | ||
| 59 | - assert.ifError(er); | ||
| 60 | - res.end(Buffer.from('bar'), 'buffer', (er) => { | ||
| 56 | + res.write('asdf', common.mustSucceed(() => { | ||
| 57 | + res.write('foo', 'ascii', common.mustSucceed(() => { | ||
| 58 | + res.end(Buffer.from('bar'), 'buffer', common.mustSucceed(() => { | ||
| 61 | 59 | serverEndCb = true; | |
| 62 | - }); | ||
| 63 | - }); | ||
| 64 | - }); | ||
| 60 | + })); | ||
| 61 | + })); | ||
| 62 | + })); | ||
| 65 | 63 | }); | |
| 66 | 64 | }); | |
| 67 | 65 | ||
@@ -79,16 +77,13 @@ server.listen(0, function() { | |||
| 79 | 77 | }); | |
| 80 | 78 | req.on('continue', () => { | |
| 81 | 79 | // ok, good to go. | |
| 82 | - req.write('YmF6', 'base64', (er) => { | ||
| 83 | - assert.ifError(er); | ||
| 84 | - req.write(Buffer.from('quux'), (er) => { | ||
| 85 | - assert.ifError(er); | ||
| 86 | - req.end('626c657267', 'hex', (er) => { | ||
| 87 | - assert.ifError(er); | ||
| 80 | + req.write('YmF6', 'base64', common.mustSucceed(() => { | ||
| 81 | + req.write(Buffer.from('quux'), common.mustSucceed(() => { | ||
| 82 | + req.end('626c657267', 'hex', common.mustSucceed(() => { | ||
| 88 | 83 | clientEndCb = true; | |
| 89 | - }); | ||
| 90 | - }); | ||
| 91 | - }); | ||
| 84 | + })); | ||
| 85 | + })); | ||
| 86 | + })); | ||
| 92 | 87 | }); | |
| 93 | 88 | req.on('response', (res) => { | |
| 94 | 89 | // This should not come until after the end is flushed out | |
| Back | FazBrowse Home | New Git URL |
0 commit comments