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

Function dispatch

github-actions/saucelabs/set-saucelabs-env.js:14753–14889  ·  view source on GitHub ↗
({ body })

Source from the content-addressed store, hash-verified

14751 } else {
14752 bytes = err;
14753 isFailure = true;
14754 }
14755 }
14756 if (bytes === void 0) {
14757 readableStreamClose(fetchParams.controller.controller);
14758 finalizeResponse(fetchParams, response);
14759 return;
14760 }
14761 timingInfo.decodedBodySize += (_a2 = bytes == null ? void 0 : bytes.byteLength) != null ? _a2 : 0;
14762 if (isFailure) {
14763 fetchParams.controller.terminate(bytes);
14764 return;
14765 }
14766 const buffer = new Uint8Array(bytes);
14767 if (buffer.byteLength) {
14768 fetchParams.controller.controller.enqueue(buffer);
14769 }
14770 if (isErrored(stream)) {
14771 fetchParams.controller.terminate();
14772 return;
14773 }
14774 if (fetchParams.controller.controller.desiredSize <= 0) {
14775 return;
14776 }
14777 }
14778 });
14779 function onAborted(reason) {
14780 if (isAborted(fetchParams)) {
14781 response.aborted = true;
14782 if (isReadable(stream)) {
14783 fetchParams.controller.controller.error(
14784 fetchParams.controller.serializedAbortReason
14785 );
14786 }
14787 } else {
14788 if (isReadable(stream)) {
14789 fetchParams.controller.controller.error(new TypeError("terminated", {
14790 cause: isErrorLike(reason) ? reason : void 0
14791 }));
14792 }
14793 }
14794 fetchParams.controller.connection.destroy();
14795 }
14796 return response;
14797 function dispatch({ body }) {
14798 const url = requestCurrentURL(request);
14799 const agent = fetchParams.controller.dispatcher;
14800 return new Promise((resolve2, reject) => agent.dispatch(
14801 {
14802 path: url.pathname + url.search,
14803 origin: url.origin,
14804 method: request.method,
14805 body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
14806 headers: request.headersList.entries,
14807 maxRedirections: 0,
14808 upgrade: request.mode === "websocket" ? "websocket" : void 0
14809 },
14810 {

Callers 5

""Function · 0.70
createDumpInterceptorFunction · 0.70
httpNetworkFetchFunction · 0.70

Calls 2

requestCurrentURLFunction · 0.70
dispatchMethod · 0.45

Tested by

no test coverage detected