Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

Cherry-pick of #31497

@alan-agius4 alan-agius4 requested a review from hybrist October 16, 2025 16:54
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Oct 16, 2025
@alan-agius4 alan-agius4 removed the action: merge The PR is ready for merge by the caretaker label Oct 16, 2025
@alan-agius4 alan-agius4 force-pushed the ssr-initial-nav branch 6 times, most recently from f5b5d55 to b1fbc88 Compare October 16, 2025 18:20
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 16, 2025
@alan-agius4 alan-agius4 removed the action: merge The PR is ready for merge by the caretaker label Oct 16, 2025
When a navigation occurs on the server-side, such as using `router.navigate`, and the final URL is different from the initial URL that was requested, the server should respond with a redirect.

Previously, the initial URL was being read from `router.lastSuccessfulNavigation.initialUrl`, which could be incorrect in scenarios involving server-side navigations, causing the comparison with the final URL to fail and preventing the redirect.

This change ensures that the initial URL requested by the browser is used for the comparison, correctly triggering a redirect when necessary.

Closes angular#31482

(cherry picked from commit 9c3a689)
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 17, 2025
@alan-agius4 alan-agius4 merged commit 5db6d64 into angular:20.3.x Oct 17, 2025
30 checks passed
@alan-agius4 alan-agius4 deleted the ssr-initial-nav branch October 17, 2025 08:10
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/ssr target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants