From c46faf6ba9dacb770ae639781758ce05a72ad261 Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Wed, 19 Aug 2026 18:10:45 +0300 Subject: [PATCH 1/3] prevent mutation of objects when merging getVars results --- lib/core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core.js b/lib/core.js index bd7ed512f..b8399cbce 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1042,13 +1042,13 @@ allResults.vars[key] = utils.filterSameObjects(allResults.vars[key]); } else { - // Merge object mode. + // Merge object mode. Prevent mutation. if (newValueOverrides) { // Extend existing object. - Object.assign(oldValue, v); + allResults.vars[key] = Object.assign({}, oldValue, v); } else { // Extend with old values on top. - allResults.vars[key] = Object.assign(v, oldValue); + allResults.vars[key] = Object.assign({}, v, oldValue); } } From a69edb0d9fca9870ac7cec1a7f1abae315af8c53 Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Fri, 21 Aug 2026 14:22:48 +0300 Subject: [PATCH 2/3] debug `options.domainOptions ` --- lib/core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/core.js b/lib/core.js index b8399cbce..4816f3da6 100644 --- a/lib/core.js +++ b/lib/core.js @@ -2193,6 +2193,7 @@ if (options.getDomainOptionsByUrl) { options.domainOptions = options.getDomainOptionsByUrl(uri); + console.log('-- domain options', uri, options.domainOptions) } // Reset `acceptHeaders` as empty array for each call. From 61c9d770e44838b81f9e15623a5dccfbfd08002f Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Fri, 21 Aug 2026 16:33:11 +0300 Subject: [PATCH 3/3] Revert "debug `options.domainOptions `" This reverts commit 5aefda0a9bc53ded62de846cf47efa27b49bc3f6. --- lib/core.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 4816f3da6..b8399cbce 100644 --- a/lib/core.js +++ b/lib/core.js @@ -2193,7 +2193,6 @@ if (options.getDomainOptionsByUrl) { options.domainOptions = options.getDomainOptionsByUrl(uri); - console.log('-- domain options', uri, options.domainOptions) } // Reset `acceptHeaders` as empty array for each call.