allow multipart upload of empty file
upgrade firstname.lastname@example.org for node 0.10
use strings on all versions for consistency
bufferedStream@1.6.0 uses setImmediate rather than process.nextTick due to a change in how nextTick works in node 0.10 this prevents a race condition where the loop is called before IO is ready.
Fixes the exception from the failing test ``` 1) multipart Parser for an empty text file upload "before each" hook: TypeError: Cannot call method 'end' of undefined at File.end (/Users/barczewskij/projects/strata/lib/multipart/file.js:48:21) at Part.Parser.onPart.content (/Users/barczewskij/projects/strata/lib/multipart/parser.js:380:12) at Part.EventEmitter.emit (events.js:93:17) at Part.end (/Users/barczewskij/projects/strata/lib/multipart/part.js:69:8) ```
utils.bufferStream safely concatenates the contents of streams that may contain multi-byte characters. All functions that need to buffer the contents of a stream should use it.
mock.call should support binary stream
Fix session delimiter problem
as well as a string by checking for optional env.mockReturnsBuffer = true Also when collecting stream data, need to use Buffer.concat since even utf8 data can be divided over chunk boundaries and result in bad concatenation. Buffer.concat is the best way to ensure this will not cause a problem.
mock.call should support a binary stream and return a Buffer, but since originally this was returning body as a string, this can be made optional. Pass env.mockReturnsBuffer = true to keep body being returned as a Buffer rather than converting to a string. Buffer.concat needs to be used rather than trying to combine Buffers as strings since even utf8 can break across chunk boundaries.
build(app, cb) was defined to allow app to be optional, but it should only shift the arguments if cb is undefined not simply if app is a function (which if passed in it is always a fn). By adding the cb is undefined check we can support the following build signatures: - build() - build(app, cb) - build(cb) - build(app, null) Added tests to describe and verify these extra 3 scenarios.