You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/03/22 16:28:40 UTC

[GitHub] rnewson closed pull request #83: Multipart get should Accept multipart/related

rnewson closed pull request #83: Multipart get should Accept multipart/related
URL: https://github.com/apache/couchdb-nano/pull/83
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/nano.js b/lib/nano.js
index 02c04e1..3b7f822 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -147,6 +147,10 @@ module.exports = exports = nano = function dbScope(cfg) {
       delete req.headers.accept;
     }
 
+    if(opts.accept) {
+      req.headers['accept'] = opts.accept;
+    }
+
     // http://guide.couchdb.org/draft/security.html#cookies
     if (cfg.cookie) {
       req.headers['X-CouchDB-WWW-Authenticate'] = 'Cookie';
@@ -703,7 +707,7 @@ module.exports = exports = nano = function dbScope(cfg) {
         db: dbName,
         doc: docName,
         encoding: null,
-        contentType: 'multipart/related',
+        accept: 'multipart/related',
         qs: qs
       }, callback);
     }
diff --git a/tests/unit/multipart/get.js b/tests/unit/multipart/get.js
index b303f56..23755ea 100644
--- a/tests/unit/multipart/get.js
+++ b/tests/unit/multipart/get.js
@@ -19,7 +19,7 @@ var getMultipart = require('../../helpers/unit').unit([
 
 getMultipart('space', {extra: 'stuff'}, {
   encoding: null,
-  headers: {'content-type': 'multipart/related'},
+  headers: {'accept': 'multipart/related'},
   method: 'GET',
   qs: {attachments: true, extra: 'stuff'},
   uri: '/mock/space'


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services