Skip to content

fix(upgrade): prevent APP_BASE_HREF duplication in locationShim.path#67157

Open
atscott wants to merge 1 commit intoangular:mainfrom
atscott:locationapphref
Open

fix(upgrade): prevent APP_BASE_HREF duplication in locationShim.path#67157
atscott wants to merge 1 commit intoangular:mainfrom
atscott:locationapphref

Conversation

@atscott
Copy link
Contributor

@atscott atscott commented Feb 19, 2026

When receives URL updates from Location.onUrlChange, it expects an internal path. However, Location emits the external path which includes the configured baseHref. Parsing this external path caused the baseHref parameter to be duplicated within locationShim.path.

This commit updates to use Location.normalize() to strip the baseHref from the emitted URL before parsing it.

This is not a breaking change as the Subject is private, and its subscriber expects an internal URL. Emitting the correct internal URL ensures public API functions and events like
carry accurate paths without duplication.

fixes #67153

When  receives URL updates from Location.onUrlChange,
it expects an internal path. However, Location emits the external path
which includes the configured baseHref. Parsing this external path caused
the baseHref parameter to be duplicated within locationShim.path.

This commit updates  to use Location.normalize() to strip
the baseHref from the emitted URL before parsing it.

This is not a breaking change as the  Subject is private,
and its subscriber expects an internal URL. Emitting the correct internal
URL ensures public API functions and events like
carry accurate paths without duplication.

fixes angular#67153
@angular-robot angular-robot bot added the area: upgrade Issues related to AngularJS → Angular upgrade APIs label Feb 19, 2026
@ngbot ngbot bot added this to the Backlog milestone Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: upgrade Issues related to AngularJS → Angular upgrade APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APP_BASE_HREF is duplicated in $locationShim

1 participant

Comments