MCPcopy Index your code
hub / github.com/nodejs/node / onResponseStart

Method onResponseStart

deps/undici/undici.js:2955–2974  ·  view source on GitHub ↗
(statusCode, headers, resume, statusText)

Source from the content-addressed store, hash-verified

2953 return this[kHandler].onResponseStarted?.();
2954 }
2955 onResponseStart(statusCode, headers, resume, statusText) {
2956 assert(!this.aborted);
2957 assert(!this.completed);
2958 if (channels.headers.hasSubscribers) {
2959 channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
2960 }
2961 const controller = this[kController];
2962 if (controller) {
2963 controller[kResume] = resume;
2964 controller.rawHeaders = headers;
2965 }
2966 const parsedHeaders = Array.isArray(headers) ? parseHeaders(headers) : headers;
2967 try {
2968 this[kHandler].onResponseStart?.(controller, statusCode, parsedHeaders, statusText);
2969 return !controller?.paused;
2970 } catch (err) {
2971 this.abort(err);
2972 return false;
2973 }
2974 }
2975 onResponseData(chunk) {
2976 assert(!this.aborted);
2977 assert(!this.completed);

Callers

nothing calls this directly

Calls 15

__nameFunction · 0.85
queueMicrotaskFunction · 0.85
runInAsyncScopeMethod · 0.80
parseHeadersFunction · 0.70
toRawHeadersFunction · 0.70
trackWritableLifecycleFunction · 0.70
abortFunction · 0.70
onResponseStartMethod · 0.65
abortMethod · 0.65
resumeMethod · 0.65
pauseMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected