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

Function makeResponse

deps/undici/src/lib/web/fetch/response.js:366–383  ·  view source on GitHub ↗
(init)

Source from the content-addressed store, hash-verified

364}
365
366function makeResponse (init) {
367 return {
368 aborted: false,
369 rangeRequested: false,
370 timingAllowPassed: false,
371 requestIncludesCredentials: false,
372 type: 'default',
373 status: 200,
374 timingInfo: null,
375 cacheState: '',
376 statusText: '',
377 ...init,
378 headersList: init?.headersList
379 ? new HeadersList(init?.headersList)
380 : new HeadersList(),
381 urlList: init?.urlList ? [...init.urlList] : []
382 }
383}
384
385function makeNetworkError (reason) {
386 const isError = isErrorLike(reason)

Callers 7

schemeFetchFunction · 0.70
httpNetworkFetchFunction · 0.70
jsonMethod · 0.70
redirectMethod · 0.70
constructorMethod · 0.70
cloneResponseFunction · 0.70
makeNetworkErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected