(boundary, size)
| 33 | console.log(`${mbPerSec} mb/sec`); |
| 34 | |
| 35 | function createMultipartBuffer(boundary, size) { |
| 36 | const head = |
| 37 | `--${boundary}\r\n` + |
| 38 | `content-disposition: form-data; name="field1"\r\n` + |
| 39 | `\r\n`; |
| 40 | const tail = `\r\n--${boundary}--\r\n`; |
| 41 | const buffer = Buffer.alloc(size); |
| 42 | |
| 43 | buffer.write(head, 0, 'ascii'); |
| 44 | buffer.write(tail, buffer.length - tail.length, 'ascii'); |
| 45 | return buffer; |
| 46 | } |
| 47 | |
| 48 | process.on('exit', () => { |
| 49 | assert.deepStrictEqual(calls, { |