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

Function responseLocationURL

deps/undici/undici.js:5267–5282  ·  view source on GitHub ↗
(response, requestFragment)

Source from the content-addressed store, hash-verified

5265 }
5266 __name(responseURL, "responseURL");
5267 function responseLocationURL(response, requestFragment) {
5268 if (!redirectStatusSet.has(response.status)) {
5269 return null;
5270 }
5271 let location = response.headersList.get("location", true);
5272 if (location !== null && isValidHeaderValue(location)) {
5273 if (!isValidEncodedURL(location)) {
5274 location = normalizeBinaryStringToUtf8(location);
5275 }
5276 location = new URL(location, responseURL(response));
5277 }
5278 if (location && !location.hash) {
5279 location.hash = requestFragment;
5280 }
5281 return location;
5282 }
5283 __name(responseLocationURL, "responseLocationURL");
5284 function isValidEncodedURL(url) {
5285 for (let i = 0; i < url.length; ++i) {

Callers 1

httpRedirectFetchFunction · 0.70

Calls 6

isValidHeaderValueFunction · 0.70
isValidEncodedURLFunction · 0.70
responseURLFunction · 0.70
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected