Skip to content

fix(@angular/ssr): replace all route parameters when resolving relative redirects#33516

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-33504-relative-redirect-multi-param
Jul 6, 2026
Merged

fix(@angular/ssr): replace all route parameters when resolving relative redirects#33516
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-33504-relative-redirect-multi-param

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

When resolving a relative redirectTo property for a route with multiple path parameters (e.g. :param1/:param2), only the first parameter segment was being converted to * because a non-global regular expression was used.

This commit updates resolveRedirectTo to use URL_PARAMETER_GLOBAL_REGEXP so that all parameter placeholders in the route path are properly replaced with *.

Fixes #33504

…ve redirects

When resolving a relative `redirectTo` property for a route with multiple path parameters (e.g. `:param1/:param2`), only the first parameter segment was being converted to `*` because a non-global regular expression was used.

This commit updates `resolveRedirectTo` to use `URL_PARAMETER_GLOBAL_REGEXP` so that all parameter placeholders in the route path are properly replaced with `*`.

Fixes angular#33504
@alan-agius4 alan-agius4 requested a review from clydin July 6, 2026 12:36
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jul 6, 2026
@alan-agius4 alan-agius4 force-pushed the fix-33504-relative-redirect-multi-param branch from 3c199f2 to 29297ec Compare July 6, 2026 12:36

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the route redirection resolution in Angular SSR to support multiple path parameters by replacing URL_PARAMETER_REGEXP with URL_PARAMETER_GLOBAL_REGEXP when resolving relative redirects. It also adds a corresponding unit test to verify nested redirects with multiple path parameters. There are no review comments, so I have no feedback to provide.

@alan-agius4 alan-agius4 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 Jul 6, 2026
@alan-agius4 alan-agius4 merged commit 0bd22da into angular:main Jul 6, 2026
40 checks passed
@alan-agius4 alan-agius4 deleted the fix-33504-relative-redirect-multi-param branch July 6, 2026 14:28
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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

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/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.

resolveRedirectTo breaks urls with several parameters

2 participants