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 }
14334 timingInfo.endTime = unsafeEndTime;
14335 let cacheState = response.cacheState;
14336 const bodyInfo = response.bodyInfo;
14337 if (!response.timingAllowPassed) {
14338 timingInfo = createOpaqueTimingInfo(timingInfo);
14339 cacheState = "";
14340 }
14341 let responseStatus = 0;
14342 if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) {
14343 responseStatus = response.status;
14344 const mimeType = extractMimeType(response.headersList);
14345 if (mimeType !== "failure") {
14346 bodyInfo.contentType = minimizeSupportedMimeType(mimeType);
14347 }
14348 }
14349 if (fetchParams.request.initiatorType != null) {
14350 markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus);
14351 }
14352 };
14353 const processResponseEndOfBodyTask = () => {
14354 fetchParams.request.done = true;
14355 if (fetchParams.processResponseEndOfBody != null) {
14356 queueMicrotask(() => fetchParams.processResponseEndOfBody(response));
14357 }
14358 if (fetchParams.request.initiatorType != null) {
14359 fetchParams.controller.reportTimingSteps();
14360 }
14361 };
14362 queueMicrotask(() => processResponseEndOfBodyTask());
14363 };
14364 if (fetchParams.processResponse != null) {
14365 queueMicrotask(() => {
14366 fetchParams.processResponse(response);
14367 fetchParams.processResponse = null;
14368 });
14369 }
14370 const internalResponse = response.type === "error" ? response : (_a = response.internalResponse) != null ? _a : response;
14371 if (internalResponse.body == null) {
14372 processResponseEndOfBody();
14373 } else {
14374 finished(internalResponse.body.stream, () => {
14375 processResponseEndOfBody();
14376 });
14377 }
14378 }
14379 function httpFetch(fetchParams) {
14380 return __async(this, null, function* () {
14381 const request = fetchParams.request;
14382 let response = null;
14383 let actualResponse = null;

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