benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 113 forks source link

Content type not correctly shown when using inline attachments #41

Closed woelli closed 13 years ago

woelli commented 13 years ago

There is a small bug in the couchbeam_attachments:add_inline/4 function that prevents the content type to be correclty stored inside Couchdb. The 3rd line in this function is:

Attachment = {list_to_binary(AName), {[{<<"content-type">>, list_to_binary(ContentType)}, {<<"data">>, Data}]}},

it should be:

Attachment = {list_to_binary(AName), {[{<<"content_type">>, list_to_binary(ContentType)}, {<<"data">>, Data}]}},

(content type is written with an underscore in CouchDB) ... tested that change and now the content types are stored correctly inside my CouchDB.

benoitc commented 13 years ago

fixed in last head, thanks