MCPcopy Index your code
hub / github.com/angular/angular / mapRequestOriginUrl

Function mapRequestOriginUrl

packages/common/http/src/transfer_cache.ts:517–529  ·  view source on GitHub ↗
(url: string, originMap: Record<string, string>)

Source from the content-addressed store, hash-verified

515}
516
517function mapRequestOriginUrl(url: string, originMap: Record<string, string>): string {
518 const origin = new URL(url, 'resolve://').origin;
519 const mappedOrigin = originMap[origin];
520 if (!mappedOrigin) {
521 return url;
522 }
523
524 if (typeof ngDevMode === 'undefined' || ngDevMode) {
525 verifyMappedOrigin(mappedOrigin);
526 }
527
528 return url.replace(origin, mappedOrigin);
529}
530
531function verifyMappedOrigin(url: string): void {
532 if (new URL(url, 'resolve://').pathname !== '/') {

Callers 2

retrieveStateFromCacheFunction · 0.85

Calls 2

verifyMappedOriginFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…