couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject couchdb-nano git commit: Ensure 'qs' is real whenever qs will be manipulated.
Date Wed, 22 Feb 2017 14:39:47 GMT
Repository: couchdb-nano
Updated Branches:
  refs/heads/master 29bc8031b -> 32cc15c8f


Ensure 'qs' is real whenever qs will be manipulated.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/32cc15c8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/32cc15c8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/32cc15c8

Branch: refs/heads/master
Commit: 32cc15c8f813e3fd7eb1be6c76d7639037f6cc28
Parents: 29bc803
Author: idearat <ss@technicalpursuit.com>
Authored: Sat Feb 11 09:34:32 2017 -0700
Committer: idearat <ss@technicalpursuit.com>
Committed: Sat Feb 11 09:34:32 2017 -0700

----------------------------------------------------------------------
 lib/nano.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/32cc15c8/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index 8789fa0..1dfd648 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -189,7 +189,7 @@ module.exports = exports = nano = function dbScope(cfg) {
       return httpAgent(req);
     }
 
-    return httpAgent(req, function(e, h, b) { 
+    return httpAgent(req, function(e, h, b) {
       rh = h && h.headers || {};
       rh.statusCode = h && h.statusCode || 500;
       rh.uri = req.uri;
@@ -330,6 +330,7 @@ module.exports = exports = nano = function dbScope(cfg) {
       qs = {};
     }
 
+    qs = qs || {};
     qs.db = urlResolveFix(cfg.url, encodeURIComponent(dbName));
 
     if (typeof callback === 'function') {
@@ -514,6 +515,7 @@ module.exports = exports = nano = function dbScope(cfg) {
         callback = qs;
         qs = {};
       }
+      qs = qs || {};
 
       var viewPath = '_design/' + ddoc + '/_' + meta.type + '/'  + viewName;
 
@@ -621,6 +623,7 @@ module.exports = exports = nano = function dbScope(cfg) {
       if (typeof qs === 'string') {
         qs = {docName: qs};
       }
+      qs = qs || {};
 
       var docName = qs.docName;
       delete qs.docName;
@@ -660,6 +663,7 @@ module.exports = exports = nano = function dbScope(cfg) {
         callback = qs;
         qs = {};
       }
+      qs = qs || {};
 
       qs.attachments = true;
 


Mime
View raw message