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

Function onRequestStart

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

Source from the content-addressed store, hash-verified

2210 abort: null,
2211
2212 onRequestStart (controller) {
2213 // TODO (fix): Do we need connection here?
2214 const { connection } = fetchParams.controller
2215
2216 // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen
2217 // connection timing info with connection’s timing info, timingInfo’s post-redirect start
2218 // time, and fetchParams’s cross-origin isolated capability.
2219 // TODO: implement connection timing
2220 timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability)
2221
2222 const abort = (reason) => controller.abort(reason)
2223
2224 if (connection.destroyed) {
2225 abort(new DOMException('The operation was aborted.', 'AbortError'))
2226 } else {
2227 fetchParams.controller.on('terminated', abort)
2228 this.abort = connection.abort = abort
2229 }
2230
2231 // Set timingInfo’s final network-request start time to the coarsened shared current time given
2232 // fetchParams’s cross-origin isolated capability.
2233 timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
2234 },
2235
2236 onResponseStarted () {
2237 // Set timingInfo’s final network-response start time to the coarsened shared current

Callers

nothing calls this directly

Calls 4

abortFunction · 0.70
onMethod · 0.45

Tested by

no test coverage detected