MCPcopy Create free account
hub / github.com/angular/angular / isDisallowedProtocolRelative

Function isDisallowedProtocolRelative

packages/platform-server/src/url.ts:135–137  ·  view source on GitHub ↗

* Checks if the resolved URL has a disallowed protocol-relative path. * * @param resolved The resolved URL. * @param allowProtocolRelative Whether protocol-relative URLs are allowed. * @returns True if the URL has a disallowed protocol-relative path, false otherwise.

(resolved: URL, allowProtocolRelative: boolean)

Source from the content-addressed store, hash-verified

133 * @returns True if the URL has a disallowed protocol-relative path, false otherwise.
134 */
135function isDisallowedProtocolRelative(resolved: URL, allowProtocolRelative: boolean): boolean {
136 return !allowProtocolRelative && resolved.pathname.startsWith('//');
137}
138
139/**
140 * Throws a protocol-relative URL error indicating that protocol-relative URLs are not allowed.

Callers 1

resolveUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected