From 2656612bc10fe2757e9832b708ed773ab340b5cb Mon Sep 17 00:00:00 2001 From: Miroslav Petrov <46135319+petrovmiroslav@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:10:18 +0200 Subject: [PATCH] fix(AxiosHeaders): fix AxiosHeaders conversion to an object during config merging (#6243) Co-authored-by: Dmitriy Mozgovoy --- lib/core/mergeConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/mergeConfig.js b/lib/core/mergeConfig.js index bbbf96d4ff..e4600e5781 100644 --- a/lib/core/mergeConfig.js +++ b/lib/core/mergeConfig.js @@ -3,7 +3,7 @@ import utils from '../utils.js'; import AxiosHeaders from "./AxiosHeaders.js"; -const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing; +const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing; /** * Config-specific merge-function which creates a new config-object