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

Function processBody

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

Source from the content-addressed store, hash-verified

783
784 // 3. Let processBody given bytes be these steps:
785 const processBody = (bytes) => {
786 // 1. If bytes do not match request’s integrity metadata,
787 // then run processBodyError and abort these steps. [SRI]
788 if (!bytesMatch(bytes, request.integrity)) {
789 processBodyError('integrity mismatch')
790 return
791 }
792
793 // 2. Set response’s body to bytes as a body.
794 response.body = safelyExtractBody(bytes)[0]
795
796 // 3. Run fetch finale given fetchParams and response.
797 fetchFinale(fetchParams, response)
798 }
799
800 // 4. Fully read response’s body given processBody and processBodyError.
801 fullyReadBody(response.body, processBody, processBodyError)

Callers

nothing calls this directly

Calls 3

processBodyErrorFunction · 0.85
safelyExtractBodyFunction · 0.70
fetchFinaleFunction · 0.70

Tested by

no test coverage detected