René's URL Explorer Experiment


Title: fix(@angular/ssr): resolve the request path through the router's URL grammar before matching by glivter · Pull Request #34091 · angular/angular-cli · GitHub

Open Graph Title: fix(@angular/ssr): resolve the request path through the router's URL grammar before matching by glivter · Pull Request #34091 · angular/angular-cli

X Title: fix(@angular/ssr): resolve the request path through the router's URL grammar before matching by glivter · Pull Request #34091 · angular/angular-cli

Description: PR Checklist The commit message follows our guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type Bugfix What is the current behavior? Issue Number: #33555 ServerRouter.match tokenises the pathname by splitting on /, while @angular/router parses it with DefaultUrlSerializer, a grammar in which (, ), ; and // are metacharacters and unparseable input is silently discarded. The two disagree on which route a request is. Verified against the published @angular/router 22.1.6, serialize(parse(x)): input router resolves to /page) /page /page( /page /page; /page /(page) /page /a/1//b /a/1 Because ServerRouter.match selects the response's headers, status, renderMode and preload while @angular/router selects the component that renders into the body, appending one character to a path produces a response whose body comes from one route and whose per-route configuration comes from another. A route configured with Cache-Control: no-store, private and X-Frame-Options: DENY is served under the catch-all's policy with neither header, and a route declared RenderMode.Client is server-rendered. The @angular/router side is intentional. (name:seg) is the documented secondary-outlet syntax, ;k=v the documented matrix-parameter syntax, and angular/angular#64507 deliberately made an unnamed (...) group mean the primary outlet. What is the new behavior? ServerRouter.match resolves the pathname through the router's own serializer before tokenising it, so both matchers agree on which route a request is. This is the same divergence that 85c18b4 fixed for matrix parameters, where it surfaced as URLs failing to match their route. stripMatrixParams handled that case; parentheses and interior // are the remaining ones. Going through the serializer covers the class rather than the next symptom, and @angular/router is already a peer dependency of this package. Normalisation runs before stripMatrixParams, because the serializer preserves matrix parameters, so they are still stripped exactly as today. A path the serializer cannot parse is returned unchanged, so malformed percent-encoding keeps its existing behaviour. Known residual, stated up front: an application that supplies a custom UrlSerializer still diverges, because this normalises with DefaultUrlSerializer. The durable fix is to build and query the route tree through the serializer the application injects, which is a larger change. I am happy to take this in that direction instead, or to have this closed in favour of an internal patch if one is already in progress; the issue matters more than the PR. Tests packages/angular/ssr/test/utils/url_spec.ts covers normalizeUrlPath directly: the divergent spellings, an unchanged ordinary path, preserved encoding including /, preserved matrix parameters, and an unparseable path returned as-is. Every expected value was measured against @angular/router 22.1.6 rather than assumed. packages/angular/ssr/test/routes/router_spec.ts covers the end-to-end selection: /home), /home(, /home; and /(home) select the same route metadata as /home, /user/123//x selects /user/*, and an unknown route still matches nothing. Both were confirmed to FAIL against main before the change, with the failure reproducing the real defect: /home): Expected undefined to equal Object({ route: '/home', renderMode: 0 }). //packages/angular/ssr/test:test is green with the change, 257 specs. Does this PR introduce a breaking change? Yes No Every path that does not use the router's metacharacters tokenises exactly as before. The behaviour change is limited to paths where the two matchers currently disagree, and there the server now agrees with what is actually rendered. Other information Originally filed as #34090, which turned out to be a duplicate of #33555 and has been closed in its favour; the additional coverage from it is now a comment on #33555. My prior-art sweep missed #33555 because I searched my own vocabulary, "route-tree tokenisation" and "matcher divergence", rather than the words a reporter would use. Credit to @SkyZeroZx for catching it. Also reported via the Google OSS VRP as 559764571, which the Bug Hunter Team triaged and invited me to disclose publicly. This change and its testing were produced with AI assistance. The equivalence table and every value asserted in the new tests were executed against the published @angular/router 22.1.6 rather than reasoned about, and the tests were confirmed to fail before the fix.

Open Graph Description: PR Checklist The commit message follows our guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type Bugf...

X Description: PR Checklist The commit message follows our guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type Bugf...

Opengraph URL: https://github.com/angular/angular-cli/pull/34091

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2f822b32-5c01-4ccb-fab9-6eebf83f932a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE092:378BB1:E6A6A:13DEDD:6AFDD800
html-safe-nonce7aad7ed91b462cf4e1544c34534abcd418c4b3865b880079a257a46d85c1a2ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDkyOjM3OEJCMTpFNkE2QToxM0RFREQ6NkFGREQ4MDAiLCJ2aXNpdG9yX2lkIjoiNzMzODI4MjQzODI3NzA2MDYwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb20ba1b5d1f8e7daa62c5b31a3e2e9c2dae2fc317bb4897b28f06479ef40b807
hovercard-subject-tagpull_request:4530702606
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/34091/files
twitter:imagehttps://avatars.githubusercontent.com/u/8862088?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8862088?s=400&v=4
og:image:altPR Checklist The commit message follows our guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type Bugf...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea231c174493a6a442c0b0544475c918b30128208
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/34091/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34091%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34091%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/pull/34091/files
Reloadhttps://github.com/angular/angular-cli/pull/34091/files
Reloadhttps://github.com/angular/angular-cli/pull/34091/files
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues196 (196)https://github.com/angular/angular-cli/issues
Pull requests20 (20)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
glivterhttps://github.com/glivter
angular:mainhttps://github.com/angular/angular-cli/tree/main
glivter:fix-ssr-route-matcher-divergencehttps://github.com/glivter/angular-cli/tree/fix-ssr-route-matcher-divergence
Conversation 4 https://github.com/angular/angular-cli/pull/34091
Commits 1 https://github.com/angular/angular-cli/pull/34091/commits
Checks 39 https://github.com/angular/angular-cli/pull/34091/checks
Files changed 4 https://github.com/angular/angular-cli/pull/34091/files
fix(@angular/ssr): resolve the request path through the router's URL grammar before matching https://github.com/angular/angular-cli/pull/34091/files#top
Show all changes 1 commit https://github.com/angular/angular-cli/pull/34091/files
6d6decb fix(@angular/ssr): resolve the request path through the router's URL … glivter Sep 14, 2026 https://github.com/angular/angular-cli/pull/34091/commits/6d6decb6af4cbd848772827e1fd14b408c2f33b0
Clear filters https://github.com/angular/angular-cli/pull/34091/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34091/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34091/files
router.ts https://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
url.ts https://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
router_spec.ts https://github.com/angular/angular-cli/pull/34091/files#diff-f7bc9a661e4a6b2b3501864fc99943cc21b87a1c5c5a098a64a3b04213d29dfd
url_spec.ts https://github.com/angular/angular-cli/pull/34091/files#diff-7c084e5be759b8630b279521d4d200a0f6cfd625bcc4ca32e47bbb4a7bb5882e
packages/angular/ssr/src/routes/router.tshttps://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
View file https://github.com/angular/angular-cli/blob/6d6decb6af4cbd848772827e1fd14b408c2f33b0/packages/angular/ssr/src/routes/router.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34091/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
https://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
https://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
https://github.com/angular/angular-cli/pull/34091/files#diff-eb7b53e837bfede12674228495a8ef7bfba9ea4c9a3e25cce936df815e240f56
packages/angular/ssr/src/utils/url.tshttps://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
View file https://github.com/angular/angular-cli/blob/6d6decb6af4cbd848772827e1fd14b408c2f33b0/packages/angular/ssr/src/utils/url.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34091/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
https://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
https://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
gemini-code-assisthttps://github.com/apps/gemini-code-assist
Sep 14, 2026https://github.com/angular/angular-cli/pull/34091/files#r4009469371
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://camo.githubusercontent.com/508ba0af8fcc5b69c2f7fd05896fc39957428ba34e1b99c6508db43cf217da8d/68747470733a2f2f7777772e677374617469632e636f6d2f636f64657265766965776167656e742f6d656469756d2d7072696f726974792e737667
Please reload this pagehttps://github.com/angular/angular-cli/pull/34091/files
glivterhttps://github.com/glivter
Sep 14, 2026https://github.com/angular/angular-cli/pull/34091/files#r4009531760
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
018fcbehttps://github.com/angular/angular-cli/commit/018fcbe7c6ba40407a6aebf775a236686290b787
Please reload this pagehttps://github.com/angular/angular-cli/pull/34091/files
https://github.com/angular/angular-cli/pull/34091/files#diff-3c008a32fe9ef8fdde37a370240701348718b1d5cdeb39a0d00690be4b2e2521
packages/angular/ssr/test/routes/router_spec.tshttps://github.com/angular/angular-cli/pull/34091/files#diff-f7bc9a661e4a6b2b3501864fc99943cc21b87a1c5c5a098a64a3b04213d29dfd
View file https://github.com/angular/angular-cli/blob/6d6decb6af4cbd848772827e1fd14b408c2f33b0/packages/angular/ssr/test/routes/router_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34091/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34091/files#diff-f7bc9a661e4a6b2b3501864fc99943cc21b87a1c5c5a098a64a3b04213d29dfd
https://github.com/angular/angular-cli/pull/34091/files#diff-f7bc9a661e4a6b2b3501864fc99943cc21b87a1c5c5a098a64a3b04213d29dfd
packages/angular/ssr/test/utils/url_spec.tshttps://github.com/angular/angular-cli/pull/34091/files#diff-7c084e5be759b8630b279521d4d200a0f6cfd625bcc4ca32e47bbb4a7bb5882e
View file https://github.com/angular/angular-cli/blob/6d6decb6af4cbd848772827e1fd14b408c2f33b0/packages/angular/ssr/test/utils/url_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34091/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34091/files#diff-7c084e5be759b8630b279521d4d200a0f6cfd625bcc4ca32e47bbb4a7bb5882e
https://github.com/angular/angular-cli/pull/34091/files#diff-7c084e5be759b8630b279521d4d200a0f6cfd625bcc4ca32e47bbb4a7bb5882e
https://github.com/angular/angular-cli/pull/34091/files#diff-7c084e5be759b8630b279521d4d200a0f6cfd625bcc4ca32e47bbb4a7bb5882e
Please reload this pagehttps://github.com/angular/angular-cli/pull/34091/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.