From 97cb68a252b45628723ab1c3fdcd886af5ec1782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9F=E4=BC=9F?= Date: Sat, 29 Sep 2018 19:28:12 +0800 Subject: [PATCH 1/5] Add withCredentials to request if needed --- lib/adapters/xhr.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 8c98d114b6..81a9e11a89 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -123,9 +123,10 @@ module.exports = function xhrAdapter(config) { } // Add withCredentials to request if needed - if (config.withCredentials) { - request.withCredentials = true; + if(typeof config.withCredentials!='undefined'){ + request.withCredentials = !!config.withCredentials; } + // Add responseType to request if needed if (config.responseType) { From 1073d79f3b808f8ed5cb2f48259cc4d5967fb160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9F=E4=BC=9F?= Date: Fri, 26 Oct 2018 15:52:02 +0800 Subject: [PATCH 2/5] Test failed. --- 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 81a9e11a89..c0825072f0 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -123,10 +123,10 @@ module.exports = function xhrAdapter(config) { } // Add withCredentials to request if needed - if(typeof config.withCredentials!='undefined'){ + // Explicit to set a true or false + if (typeof config.withCredentials !== 'undefined') { request.withCredentials = !!config.withCredentials; } - // Add responseType to request if needed if (config.responseType) { From c2ae83c8c2188493acd56b6d6618c5314868aac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9F=E4=BC=9F?= Date: Fri, 26 Oct 2018 15:59:11 +0800 Subject: [PATCH 3/5] no message --- lib/adapters/xhr.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index c0825072f0..a5a2c3ed49 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -122,12 +122,11 @@ module.exports = function xhrAdapter(config) { }); } - // Add withCredentials to request if needed - // Explicit to set a true or false + // Add withCredentials to request if needed. Explicit to set a true or false if (typeof config.withCredentials !== 'undefined') { request.withCredentials = !!config.withCredentials; } - + // Add responseType to request if needed if (config.responseType) { try { From 2347ace0a02b96b82f055d6c5d7115c94c2b8019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9F=E4=BC=9F?= Date: Fri, 26 Oct 2018 16:09:32 +0800 Subject: [PATCH 4/5] no message --- lib/adapters/xhr.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index a5a2c3ed49..cbd4d2897f 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -122,11 +122,10 @@ module.exports = function xhrAdapter(config) { }); } - // Add withCredentials to request if needed. Explicit to set a true or false + // Add withCredentials to request if needed. Explicit to set a true or false if (typeof config.withCredentials !== 'undefined') { request.withCredentials = !!config.withCredentials; - } - + } // Add responseType to request if needed if (config.responseType) { try { From c06f8bd5473676f10d949b9304a813a5cc70e4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=9F=E4=BC=9F?= Date: Fri, 26 Oct 2018 16:13:02 +0800 Subject: [PATCH 5/5] no message --- lib/adapters/xhr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index cbd4d2897f..5a0fae426c 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -125,7 +125,7 @@ module.exports = function xhrAdapter(config) { // Add withCredentials to request if needed. Explicit to set a true or false if (typeof config.withCredentials !== 'undefined') { request.withCredentials = !!config.withCredentials; - } + } // Add responseType to request if needed if (config.responseType) { try {