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

Function onHeaders

github-actions/browserstack/set-browserstack-env.js:14783–14843  ·  view source on GitHub ↗
(status, rawHeaders, resume, statusText)

Source from the content-addressed store, hash-verified

14781 const processEndOfBody = () => {
14782 if (isCancelled(fetchParams)) {
14783 return;
14784 }
14785 if (fetchParams.processRequestEndOfBody) {
14786 fetchParams.processRequestEndOfBody();
14787 }
14788 };
14789 const processBodyError = (e) => {
14790 if (isCancelled(fetchParams)) {
14791 return;
14792 }
14793 if (e.name === "AbortError") {
14794 fetchParams.controller.abort();
14795 } else {
14796 fetchParams.controller.terminate(e);
14797 }
14798 };
14799 requestBody = function() {
14800 return __asyncGenerator(this, null, function* () {
14801 try {
14802 try {
14803 for (var iter = __forAwait(request.body.stream), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
14804 const bytes = temp.value;
14805 yield* __yieldStar(processBodyChunk(bytes));
14806 }
14807 } catch (temp) {
14808 error = [temp];
14809 } finally {
14810 try {
14811 more && (temp = iter.return) && (yield new __await(temp.call(iter)));
14812 } finally {
14813 if (error)
14814 throw error[0];
14815 }
14816 }
14817 processEndOfBody();
14818 } catch (err) {
14819 processBodyError(err);
14820 }
14821 });
14822 }();
14823 }
14824 try {
14825 const { body, status, statusText, headersList, socket } = yield dispatch({ body: requestBody });
14826 if (socket) {
14827 response = makeResponse({ status, statusText, headersList, socket });
14828 } else {
14829 const iterator = body[Symbol.asyncIterator]();
14830 fetchParams.controller.next = () => iterator.next();
14831 response = makeResponse({ status, statusText, headersList });
14832 }
14833 } catch (err) {
14834 if (err.name === "AbortError") {
14835 fetchParams.controller.connection.destroy();
14836 return makeAppropriateNetworkError(fetchParams, err);
14837 }
14838 return makeNetworkError(err);
14839 }
14840 const pullAlgorithm = () => __async(this, null, function* () {

Callers

nothing calls this directly

Calls 10

createInflateFunction · 0.70
pipelineFunction · 0.70
appendMethod · 0.45
toStringMethod · 0.45
getMethod · 0.45
hasMethod · 0.45
pushMethod · 0.45
onMethod · 0.45
onErrorMethod · 0.45

Tested by

no test coverage detected