MCPcopy Create free account
hub / github.com/angular/dev-infra / responseLocationURL

Function responseLocationURL

github-actions/saucelabs/set-saucelabs-env.js:4245–4260  ·  view source on GitHub ↗
(response, requestFragment)

Source from the content-addressed store, hash-verified

4243 const possibleRelevantHashes = ["sha256", "sha384", "sha512"];
4244 supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
4245 } catch (e) {
4246 }
4247 function responseURL(response) {
4248 const urlList = response.urlList;
4249 const length = urlList.length;
4250 return length === 0 ? null : urlList[length - 1].toString();
4251 }
4252 function responseLocationURL(response, requestFragment) {
4253 if (!redirectStatusSet.has(response.status)) {
4254 return null;
4255 }
4256 let location = response.headersList.get("location", true);
4257 if (location !== null && isValidHeaderValue(location)) {
4258 if (!isValidEncodedURL(location)) {
4259 location = normalizeBinaryStringToUtf8(location);
4260 }
4261 location = new URL(location, responseURL(response));
4262 }
4263 if (location && !location.hash) {

Callers 1

httpRedirectFetchFunction · 0.70

Calls 6

isValidHeaderValueFunction · 0.70
isValidEncodedURLFunction · 0.70
responseURLFunction · 0.70
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected