2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

fix(fetch): fix withCredentials request config (#6505)

This commit is contained in:
prianYu
2024-08-01 20:26:06 +08:00
committed by GitHub
parent 92cd8ed943
commit 85d4d0ea0a
+2 -2
View File
@@ -155,7 +155,7 @@ export default isFetchSupported && (async (config) => {
} }
if (!utils.isString(withCredentials)) { if (!utils.isString(withCredentials)) {
withCredentials = withCredentials ? 'cors' : 'omit'; withCredentials = withCredentials ? 'include' : 'omit';
} }
request = new Request(url, { request = new Request(url, {
@@ -165,7 +165,7 @@ export default isFetchSupported && (async (config) => {
headers: headers.normalize().toJSON(), headers: headers.normalize().toJSON(),
body: data, body: data,
duplex: "half", duplex: "half",
withCredentials credentials: withCredentials
}); });
let response = await fetch(request); let response = await fetch(request);