Skip to content

Commit

Permalink
fix(@angular/build): handle relative URLs when constructing new URLs …
Browse files Browse the repository at this point in the history
…during server fetch

Ensures proper handling of relative URLs to prevent errors in server-side fetch operations.

Closes angular#29236
  • Loading branch information
alan-agius4 committed Jan 6, 2025
1 parent c40d726 commit 844339b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export function patchFetchToLoadInMemoryAssets(baseURL: URL): void {
if (input instanceof URL) {
url = input;
} else if (typeof input === 'string') {
url = new URL(input);
url = new URL(input, baseURL);
} else if (typeof input === 'object' && 'url' in input) {
url = new URL(input.url);
url = new URL(input.url, baseURL);
} else {
return originalFetch(input, init);
}
Expand Down

0 comments on commit 844339b

Please sign in to comment.