Permalink
Browse files

Client: Handle inline attachments better

CouchDB 1.1 added multipart replies to attachments=true as default.
Passing application/json circumvents this. However, this should be
properly fixed in future releases.
  • Loading branch information...
1 parent 81c0bd3 commit 5f5aa6d033e16a02bc11e0c5b37fa4d343e8a212 @nailor nailor committed Jun 23, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 trombi/client.py
View
7 trombi/client.py
@@ -352,12 +352,19 @@ def _really_callback(response):
doc_id = urllib.quote(doc_id, safe='')
+ kwargs = {}
+
if attachments is True:
doc_id += '?attachments=true'
+ kwargs['headers'] = HTTPHeaders(
+ {'Content-Type': 'application/json',
+ 'Accept': 'application/json',
+ })
self._fetch(
doc_id,
_really_callback,
+ **kwargs
)
def get_attachment(self, doc_id, attachment_name, callback):

0 comments on commit 5f5aa6d

Please sign in to comment.