Skip to content

fix(common): only strip a literal /index.html suffix from URLs#68998

Open
rootvector2 wants to merge 1 commit into
angular:mainfrom
rootvector2:location-strip-index-html-regex
Open

fix(common): only strip a literal /index.html suffix from URLs#68998
rootvector2 wants to merge 1 commit into
angular:mainfrom
rootvector2:location-strip-index-html-regex

Conversation

@rootvector2
Copy link
Copy Markdown

Hit this while exercising Location.normalize with route paths that end in
non-.html suffixes. The unescaped . in the strip regex inside
_stripIndexHtml matches any character, so e.g. /foo/indexXhtml and
/foo/index_html both collapse to /foo before the base-path strip and end
up resolving to the wrong route. Escape the dot so only the literal
/index.html suffix is stripped.

@pullapprove pullapprove Bot requested a review from JeanMeche May 28, 2026 18:30
@angular-robot angular-robot Bot added the area: common Issues related to APIs in the @angular/common package label May 28, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 28, 2026
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label May 28, 2026
@alan-agius4 alan-agius4 added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: common Issues related to APIs in the @angular/common package 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