Skip to content

Commit c822f8f

Browse files
committed
fix(@angular/build): handle relative URLs when constructing new URLs during server fetch
Ensures proper handling of relative URLs to prevent errors in server-side fetch operations. Closes #29236 (cherry picked from commit a0b4ea2)
1 parent e973643 commit c822f8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: packages/angular/build/src/utils/server-rendering/fetch-patch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export function patchFetchToLoadInMemoryAssets(baseURL: URL): void {
2828
if (input instanceof URL) {
2929
url = input;
3030
} else if (typeof input === 'string') {
31-
url = new URL(input);
31+
url = new URL(input, baseURL);
3232
} else if (typeof input === 'object' && 'url' in input) {
33-
url = new URL(input.url);
33+
url = new URL(input.url, baseURL);
3434
} else {
3535
return originalFetch(input, init);
3636
}

0 commit comments

Comments
 (0)