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

Method url

github-actions/browserstack/set-browserstack-env.js:12749–12758  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12747 static redirect(url, status = 302) {
12748 webidl.argumentLengthCheck(arguments, 1, "Response.redirect");
12749 url = webidl.converters.USVString(url);
12750 status = webidl.converters["unsigned short"](status);
12751 let parsedURL;
12752 try {
12753 parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl);
12754 } catch (err) {
12755 throw new TypeError(`Failed to parse URL from ${url}`, { cause: err });
12756 }
12757 if (!redirectStatusSet.has(status)) {
12758 throw new RangeError(`Invalid status code ${status}`);
12759 }
12760 const responseObject = fromInnerResponse(makeResponse({}), "immutable");
12761 responseObject[kState].status = status;

Callers

nothing calls this directly

Calls 1

URLSerializerFunction · 0.70

Tested by

no test coverage detected