MCPcopy Create free account
hub / github.com/angular/dev-infra / schemeFetch

Function schemeFetch

github-actions/browserstack/set-browserstack-env.js:14181–14271  ·  view source on GitHub ↗
(fetchParams)

Source from the content-addressed store, hash-verified

14179 }
14180 if (responseObject == null) {
14181 return;
14182 }
14183 const response = responseObject[kState];
14184 if (response.body != null && isReadable((_b = response.body) == null ? void 0 : _b.stream)) {
14185 response.body.stream.cancel(error).catch((err) => {
14186 if (err.code === "ERR_INVALID_STATE") {
14187 return;
14188 }
14189 throw err;
14190 });
14191 }
14192 }
14193 function fetching({
14194 request,
14195 processRequestBodyChunkLength,
14196 processRequestEndOfBody,
14197 processResponse,
14198 processResponseEndOfBody,
14199 processResponseConsumeBody,
14200 useParallelQueue = false,
14201 dispatcher = getGlobalDispatcher()
14202 // undici
14203 }) {
14204 var _a, _b, _c;
14205 assert(dispatcher);
14206 let taskDestination = null;
14207 let crossOriginIsolatedCapability = false;
14208 if (request.client != null) {
14209 taskDestination = request.client.globalObject;
14210 crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability;
14211 }
14212 const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability);
14213 const timingInfo = createOpaqueTimingInfo({
14214 startTime: currentTime
14215 });
14216 const fetchParams = {
14217 controller: new Fetch(dispatcher),
14218 request,
14219 timingInfo,
14220 processRequestBodyChunkLength,
14221 processRequestEndOfBody,
14222 processResponse,
14223 processResponseConsumeBody,
14224 processResponseEndOfBody,
14225 taskDestination,
14226 crossOriginIsolatedCapability
14227 };
14228 assert(!request.body || request.body.stream);
14229 if (request.window === "client") {
14230 request.window = ((_c = (_b = (_a = request.client) == null ? void 0 : _a.globalObject) == null ? void 0 : _b.constructor) == null ? void 0 : _c.name) === "Window" ? request.client : "no-window";
14231 }
14232 if (request.origin === "client") {
14233 request.origin = request.client.origin;
14234 }
14235 if (request.policyContainer === "client") {
14236 if (request.client != null) {
14237 request.policyContainer = clonePolicyContainer(
14238 request.client.policyContainer

Callers 1

mainFetchFunction · 0.70

Calls 15

isCancelledFunction · 0.70
requestCurrentURLFunction · 0.70
makeNetworkErrorFunction · 0.70
isBlobLikeFunction · 0.70
makeResponseFunction · 0.70
isomorphicEncodeFunction · 0.70
extractBodyFunction · 0.70
simpleRangeHeaderValueFunction · 0.70
buildContentRangeFunction · 0.70
dataURLProcessorFunction · 0.70
serializeAMimeTypeFunction · 0.70

Tested by

no test coverage detected