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 2021/08/26 13:51:35 UTC

[couchdb-nano] 01/01: use selective attribute copy instead of clone to avoid circular references - fixes issue #274

This is an automated email from the ASF dual-hosted git repository.

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

commit c7870d63b5b494cadb0e16f2f995b7ae67373627
Author: Glynn Bird <gl...@apache.org>
AuthorDate: Thu Aug 26 14:51:20 2021 +0100

    use selective attribute copy instead of clone to avoid circular references - fixes issue #274
---
 lib/nano.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/nano.js b/lib/nano.js
index 5a4ee28..a2edb96 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -381,7 +381,11 @@ module.exports = exports = function dbScope (cfg) {
     }
 
     // scrub and log
-    const scrubbedReq = JSON.parse(JSON.stringify(req))
+    const scrubbedReq = {
+      method: req.method,
+      headers: req.headers,
+      url: req.url
+    }
     scrubRequest(scrubbedReq, true)
     log(scrubbedReq)