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

Function filterResponse

deps/undici/undici.js:12281–12311  ·  view source on GitHub ↗
(response, type)

Source from the content-addressed store, hash-verified

12279 }
12280 __name(makeFilteredResponse, "makeFilteredResponse");
12281 function filterResponse(response, type) {
12282 if (type === "basic") {
12283 return makeFilteredResponse(response, {
12284 type: "basic",
12285 headersList: response.headersList
12286 });
12287 } else if (type === "cors") {
12288 return makeFilteredResponse(response, {
12289 type: "cors",
12290 headersList: response.headersList
12291 });
12292 } else if (type === "opaque") {
12293 return makeFilteredResponse(response, {
12294 type: "opaque",
12295 urlList: [],
12296 status: 0,
12297 statusText: "",
12298 body: null
12299 });
12300 } else if (type === "opaqueredirect") {
12301 return makeFilteredResponse(response, {
12302 type: "opaqueredirect",
12303 status: 0,
12304 statusText: "",
12305 headersList: [],
12306 body: null
12307 });
12308 } else {
12309 assert(false);
12310 }
12311 }
12312 __name(filterResponse, "filterResponse");
12313 function makeAppropriateNetworkError(fetchParams, err = null) {
12314 assert(isCancelled(fetchParams));

Callers 2

cloneResponseFunction · 0.70
mainFetchFunction · 0.70

Calls 2

makeFilteredResponseFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…