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

Function onClientRequestBodyChunkReceived

lib/internal/inspector/network_undici.js:180–192  ·  view source on GitHub ↗

* When a chunk of the response body has been received, cache it until `getResponseBody` request * https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getResponseBody or * stream it with `streamResourceContent` request. * https://chromedevtools.github.io/devtools-protocol/tot/Ne

({ request, chunk })

Source from the content-addressed store, hash-verified

178 * @param {{ request: undici.Request, chunk: Uint8Array | string }} event
179 */
180function onClientRequestBodyChunkReceived({ request, chunk }) {
181 if (typeof request[kInspectorRequestId] !== 'string') {
182 return;
183 }
184
185 Network.dataReceived({
186 requestId: request[kInspectorRequestId],
187 timestamp: getMonotonicTime(),
188 dataLength: chunk.byteLength,
189 encodedDataLength: chunk.byteLength,
190 data: chunk,
191 });
192}
193
194/**
195 * When a response is completed, emit Network.loadingFinished event.

Callers

nothing calls this directly

Calls 1

getMonotonicTimeFunction · 0.85

Tested by

no test coverage detected