spumko/hapi — pull request #774 by skoni (2013-04-18 10:59:16+00:00)
Title: Fix multipart encoding #771

Formidable gets the payload buffer after .toString('utf-8') has been called on it. This works for text, but not for binary data in a multipart request. I changed the payload.parse method to pass the 'raw' payload buffer to formidable and updated the test. The test now passes a stream to form-data, so that it encodes the binary data as file in the multipart request and formidable recognizes it as such. The test then compares the filesize and the actual file contents of the source file and the written tmp file. Would be nice if you can take a look at it.