From dc4bc49673943e35280e5df831f5c3d0347a9393 Mon Sep 17 00:00:00 2001 From: ZhaoXC Date: Mon, 9 Dec 2019 15:52:45 +0800 Subject: [PATCH] fix: fix ignore set withCredentials false (#2582) --- lib/adapters/xhr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 7e8668dade..377e3e96e0 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -129,8 +129,8 @@ module.exports = function xhrAdapter(config) { } // Add withCredentials to request if needed - if (config.withCredentials) { - request.withCredentials = true; + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed