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

Function httpFetch

github-actions/saucelabs/set-saucelabs-env.js:14335–14380  ·  view source on GitHub ↗
(fetchParams)

Source from the content-addressed store, hash-verified

14333 return Promise.resolve(makeNetworkError("unknown scheme"));
14334 }
14335 }
14336 }
14337 function finalizeResponse(fetchParams, response) {
14338 fetchParams.request.done = true;
14339 if (fetchParams.processResponseDone != null) {
14340 queueMicrotask(() => fetchParams.processResponseDone(response));
14341 }
14342 }
14343 function fetchFinale(fetchParams, response) {
14344 var _a;
14345 let timingInfo = fetchParams.timingInfo;
14346 const processResponseEndOfBody = () => {
14347 const unsafeEndTime = Date.now();
14348 if (fetchParams.request.destination === "document") {
14349 fetchParams.controller.fullTimingInfo = timingInfo;
14350 }
14351 fetchParams.controller.reportTimingSteps = () => {
14352 if (fetchParams.request.url.protocol !== "https:") {
14353 return;
14354 }
14355 timingInfo.endTime = unsafeEndTime;
14356 let cacheState = response.cacheState;
14357 const bodyInfo = response.bodyInfo;
14358 if (!response.timingAllowPassed) {
14359 timingInfo = createOpaqueTimingInfo(timingInfo);
14360 cacheState = "";
14361 }
14362 let responseStatus = 0;
14363 if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) {
14364 responseStatus = response.status;
14365 const mimeType = extractMimeType(response.headersList);
14366 if (mimeType !== "failure") {
14367 bodyInfo.contentType = minimizeSupportedMimeType(mimeType);
14368 }
14369 }
14370 if (fetchParams.request.initiatorType != null) {
14371 markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus);
14372 }
14373 };
14374 const processResponseEndOfBodyTask = () => {
14375 fetchParams.request.done = true;
14376 if (fetchParams.processResponseEndOfBody != null) {
14377 queueMicrotask(() => fetchParams.processResponseEndOfBody(response));
14378 }
14379 if (fetchParams.request.initiatorType != null) {
14380 fetchParams.controller.reportTimingSteps();
14381 }
14382 };
14383 queueMicrotask(() => processResponseEndOfBodyTask());

Callers 2

mainFetchFunction · 0.70
schemeFetchFunction · 0.70

Calls 9

__asyncFunction · 0.70
httpNetworkOrCacheFetchFunction · 0.70
corsCheckFunction · 0.70
makeNetworkErrorFunction · 0.70
TAOCheckFunction · 0.70
httpRedirectFetchFunction · 0.70
hasMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected