MCPcopy Create free account
hub / github.com/nodejs/node / processResponseEndOfBodyTask

Function processResponseEndOfBodyTask

deps/undici/src/lib/web/fetch/index.js:1093–1109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1091
1092 // 4. Let processResponseEndOfBodyTask be the following steps:
1093 const processResponseEndOfBodyTask = () => {
1094 // 1. Set fetchParams’s request’s done flag.
1095 fetchParams.request.done = true
1096
1097 // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process
1098 // response end-of-body given response.
1099 if (fetchParams.processResponseEndOfBody != null) {
1100 queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
1101 }
1102
1103 // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s
1104 // global object is fetchParams’s task destination, then run fetchParams’s controller’s report
1105 // timing steps given fetchParams’s request’s client’s global object.
1106 if (fetchParams.request.initiatorType != null) {
1107 fetchParams.controller.reportTimingSteps()
1108 }
1109 }
1110
1111 // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination
1112 queueMicrotask(() => processResponseEndOfBodyTask())

Callers 2

fetchFinaleFunction · 0.85
processResponseEndOfBodyFunction · 0.85

Calls 2

queueMicrotaskFunction · 0.85

Tested by

no test coverage detected