Comparing version
@@ -30,2 +30,3 @@ // Licensed under the Apache License, Version 2.0 (the 'License'); you may not | ||
const ChangesReader = require('./changesreader.js') | ||
const MultiPartFactory = require('./multipart.js') | ||
@@ -286,3 +287,7 @@ function isEmpty (val) { | ||
if (opts.multipart) { | ||
req.multipart = opts.multipart | ||
// generate the multipart/related body, header and boundary to | ||
// upload multiple binary attachments in one request | ||
const mp = new MultiPartFactory(opts.multipart) | ||
opts.contentType = mp.header | ||
req.body = mp.data | ||
} | ||
@@ -896,8 +901,9 @@ | ||
} | ||
multipart.push({ body: att.data }) | ||
multipart.push(att) | ||
}) | ||
multipart.unshift({ | ||
'content-type': 'application/json', | ||
body: JSON.stringify(doc) | ||
content_type: 'application/json', | ||
data: JSON.stringify(doc), | ||
name: 'document' | ||
}) | ||
@@ -904,0 +910,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"repository": "http://github.com/apache/couchdb-nano", | ||
"version": "9.0.4", | ||
"version": "9.0.5", | ||
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
176710
1.18%12
9.09%2956
1.65%