MCPcopy
hub / github.com/di-sukharev/opencommit / responseLocationURL

Function responseLocationURL

out/cli.cjs:50473–50485  ·  view source on GitHub ↗
(response, requestFragment)

Source from the content-addressed store, hash-verified

50471 supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash));
50472 } catch {
50473 }
50474 function responseURL(response) {
50475 const urlList = response.urlList;
50476 const length = urlList.length;
50477 return length === 0 ? null : urlList[length - 1].toString();
50478 }
50479 function responseLocationURL(response, requestFragment) {
50480 if (!redirectStatusSet.has(response.status)) {
50481 return null;
50482 }
50483 let location = response.headersList.get("location");
50484 if (location !== null && isValidHeaderValue(location)) {
50485 location = new URL(location, responseURL(response));
50486 }
50487 if (location && !location.hash) {
50488 location.hash = requestFragment;

Callers 1

httpRedirectFetchFunction · 0.85

Calls 4

isValidHeaderValueFunction · 0.85
responseURLFunction · 0.85
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…