allow multipart upload of empty file #41

Merged
merged 2 commits into from Mar 20, 2013

Projects

None yet

2 participants

@jeffbski

uploading an empty file caused an exception in the multipart/file because writeStream was not previously created.

I added a failing test and then the fix which creates the stream in the constructor.

 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)
jeffbski added some commits Mar 15, 2013
@jeffbski jeffbski add test for multipart upload empty file 3d8eb8d
@jeffbski jeffbski allow multipart upload of empty file
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)
```
37b2157
@mjackson mjackson merged commit f1f0695 into mjackson:master Mar 20, 2013

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment