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

Function setRequestReferrerPolicyOnRedirect

out/cli.cjs:50557–50573  ·  view source on GitHub ↗
(request3, actualResponse)

Source from the content-addressed store, hash-verified

50555 if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) {
50556 return false;
50557 }
50558 if (potentialValue.includes("\0") || potentialValue.includes("\r") || potentialValue.includes("\n")) {
50559 return false;
50560 }
50561 return true;
50562 }
50563 function setRequestReferrerPolicyOnRedirect(request3, actualResponse) {
50564 const { headersList } = actualResponse;
50565 const policyHeader = (headersList.get("referrer-policy") ?? "").split(",");
50566 let policy = "";
50567 if (policyHeader.length > 0) {
50568 for (let i3 = policyHeader.length; i3 !== 0; i3--) {
50569 const token = policyHeader[i3 - 1].trim();
50570 if (referrerPolicyTokens.has(token)) {
50571 policy = token;
50572 break;
50573 }
50574 }
50575 }
50576 if (policy !== "") {

Callers 1

httpRedirectFetchFunction · 0.85

Calls 3

trimMethod · 0.80
getMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…