From 6744ccd3f8e50579982114aefda040f107459bd2 Mon Sep 17 00:00:00 2001 From: "B.J. Rossiter" Date: Fri, 6 Dec 2019 08:38:41 +1100 Subject: [PATCH] Allow setting of withCredentials to false (solves #1852) --- lib/adapters/xhr.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 7e8668dade..9a1fe43038 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -128,9 +128,9 @@ module.exports = function xhrAdapter(config) { }); } - // Add withCredentials to request if needed - if (config.withCredentials) { - request.withCredentials = true; + // Add withCredentials to request if needed. + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = config.withCredentials; } // Add responseType to request if needed