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

Function stripURLForReferrer

github-actions/saucelabs/set-saucelabs-env.js:4461–4475  ·  view source on GitHub ↗
(url, originOnly)

Source from the content-addressed store, hash-verified

4459 }
4460 return referrerOrigin;
4461 }
4462 case "strict-origin":
4463 case "no-referrer-when-downgrade":
4464 default:
4465 return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
4466 }
4467 }
4468 function stripURLForReferrer(url, originOnly) {
4469 assert(url instanceof URL);
4470 url = new URL(url);
4471 if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") {
4472 return "no-referrer";
4473 }
4474 url.username = "";
4475 url.password = "";
4476 url.hash = "";
4477 if (originOnly) {
4478 url.pathname = "";

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected