You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2018/06/25 13:33:47 UTC

[couchdb-nano] 01/01: clone use-supplied query string object prior to mutation - fixes issue #85

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 <gl...@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