daleharvey/pouchdb — pull request #542 by nick-thompson (2013-03-05 18:55:28+00:00)
Title: LevelDB adapter assumes attachments are base64 encoded

In the bulkDocs method on the leveldb adapter, when writing a document that contains an attachment, the adapter assumes that if the attachment is a string, it will necessarily be base64 encoded: https://github.com/daleharvey/pouchdb/blob/master/src/adapters/pouch.leveldb.js#L416

This breaks pouchdb-server in the case where our test suite sends a non-encoded attachment string, which then gets forwarded to this write method, which throws an error trying to decode a "malformed URI".