Skip to content

fix(router): fall back when serializing protocol-relative URLs - #71142

Open
atscott wants to merge 1 commit into
angular:21.2.xfrom
atscott:fix-protocol-relative-21.2.x
Open

atscott wants to merge 1 commit into
angular:21.2.xfrom
atscott:fix-protocol-relative-21.2.x

Conversation

@atscott

@atscott atscott commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Backports #71094 to 21.2.x.

Avoid throwing when DefaultUrlSerializer encounters a UrlTree that would serialize to a protocol-relative URL. Warn in development mode and serialize the tree with a root-relative path instead while preserving query parameters and fragments.

Additionally, account for WHATWG URL normalization (e.g. dot segments and backslashes collapsing into protocol-relative paths such as /.// or /..//).

Fixes #69700
Fixes #71076

Avoid throwing when DefaultUrlSerializer encounters a UrlTree that would serialize to a protocol-relative URL. Warn in development mode and serialize the tree with a root-relative path instead while preserving query parameters and fragments.

Additionally, account for WHATWG URL normalization (e.g. dot segments and backslashes collapsing into protocol-relative paths such as `/.//` or `/..//`).

Fixes angular#69700
Fixes angular#71076

Co-authored-by: Andrew Scott <atscott01@gmail.com>
@pullapprove
pullapprove Bot requested review from JeanMeche and crisbeto October 2, 2026 16:05
@ngbot ngbot Bot added this to the Backlog milestone Oct 2, 2026
@pullapprove
pullapprove Bot requested a review from JeanMeche October 2, 2026 16:07
@pullapprove
pullapprove Bot requested a review from JeanMeche October 2, 2026 16:07
@atscott atscott added target: lts This PR is targeting a version currently in long-term support state: blocked labels Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: router state: blocked target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants