couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From glynnb...@apache.org
Subject [couchdb-nano] 01/01: clone use-supplied query string object prior to mutation - fixes issue #85
Date Mon, 25 Jun 2018 13:33:47 GMT
This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch issue85
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git

commit 685326cf0b4f243d397eecc05225e0f0bbcd86c7
Author: Glynn Bird <glynn.bird@gmail.com>
AuthorDate: Mon Jun 25 14:33:36 2018 +0100

    clone use-supplied query string object prior to mutation - fixes issue #85
---
 lib/nano.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/nano.js b/lib/nano.js
index 3b7f822..37e86db 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -553,6 +553,9 @@ module.exports = exports = nano = function dbScope(cfg) {
       }
       qs = qs || {};
 
+      // prevent mutation of the client qs object by using a clone
+      qs = JSON.parse(JSON.stringify(qs))
+
       var viewPath = '_design/' + ddoc + '/_' + meta.type + '/'  + viewName;
 
       // Several search parameters must be JSON-encoded; but since this is an


Mime
View raw message