Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Nov 21, 2025

Cherry-pick of #31884 and #31883

Previously, encoded query parameters caused a mismatch between the requested URL and the reconstructed URL, leading to a redirect loop. This change ensures both URLs are decoded before comparison.

Closes angular#31881

(cherry picked from commit 61a027d)
This commit addresses an issue where prerendering with i18n and a `routesFile` could lead to infinite redirect loops or failure to prerender `index.html`.

The previous `urlJoin` utility was replaced with more robust URL manipulation functions (`joinUrlParts`, `addTrailingSlash`, `stripLeadingSlash`) to ensure that paths are correctly constructed, especially when dealing with base hrefs and locale subpaths. This ensures that routes from the `routesFile` are correctly joined with the base href, preventing malformed URLs that cause the redirection issues.

Closes angular#31877

(cherry picked from commit 0fe572e)
@alan-agius4 alan-agius4 requested a review from dgp1130 November 21, 2025 15:01
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: lts This PR is targeting a version currently in long-term support labels Nov 21, 2025
@alan-agius4 alan-agius4 marked this pull request as ready for review November 21, 2025 17:40
@alan-agius4 alan-agius4 changed the title Cherry-pick several SSR fixes to 20.3.x Cherry-pick several SSR/SSG fixes to 20.3.x Nov 21, 2025
@dgp1130 dgp1130 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 21, 2025
@dgp1130 dgp1130 merged commit 25bb7e6 into angular:20.3.x Nov 21, 2025
36 of 37 checks passed
@dgp1130
Copy link
Collaborator

dgp1130 commented Nov 21, 2025

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the cherry-pick-ssr-fixes branch November 21, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build area: @angular/ssr target: lts This PR is targeting a version currently in long-term support

Projects

None yet

2 participants