From 85d4d0ea0aae91082f04e303dec46510d1b4e787 Mon Sep 17 00:00:00 2001 From: prianYu Date: Thu, 1 Aug 2024 20:26:06 +0800 Subject: [PATCH] fix(fetch): fix withCredentials request config (#6505) --- lib/adapters/fetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/adapters/fetch.js b/lib/adapters/fetch.js index 1104553..06dece9 100644 --- a/lib/adapters/fetch.js +++ b/lib/adapters/fetch.js @@ -155,7 +155,7 @@ export default isFetchSupported && (async (config) => { } if (!utils.isString(withCredentials)) { - withCredentials = withCredentials ? 'cors' : 'omit'; + withCredentials = withCredentials ? 'include' : 'omit'; } request = new Request(url, { @@ -165,7 +165,7 @@ export default isFetchSupported && (async (config) => { headers: headers.normalize().toJSON(), body: data, duplex: "half", - withCredentials + credentials: withCredentials }); let response = await fetch(request);