MCPcopy Create free account
hub / github.com/nodejs/node / createPotentialCORSRequest

Function createPotentialCORSRequest

deps/undici/undici.js:16350–16366  ·  view source on GitHub ↗
(url, destination, corsAttributeState, sameOriginFallback)

Source from the content-addressed store, hash-verified

16348 }
16349 __name(isASCIINumber, "isASCIINumber");
16350 function createPotentialCORSRequest(url, destination, corsAttributeState, sameOriginFallback) {
16351 let mode = corsAttributeState === "no cors" ? "no-cors" : "cors";
16352 if (sameOriginFallback && mode === "no-cors") {
16353 mode = "same-origin";
16354 }
16355 let credentialsMode = "include";
16356 if (corsAttributeState === "anonymous") {
16357 credentialsMode = "same-origin";
16358 }
16359 return makeRequest({
16360 urlList: [url],
16361 destination,
16362 mode,
16363 credentials: credentialsMode,
16364 useCredentials: true
16365 });
16366 }
16367 __name(createPotentialCORSRequest, "createPotentialCORSRequest");
16368 module2.exports = {
16369 isValidLastEventId,

Callers 1

constructorMethod · 0.70

Calls 1

makeRequestFunction · 0.70

Tested by

no test coverage detected