Commit 9650131
fix(vanity-url): restore /c/ trailing slash in BACKEND_FILTERED_COLLECTION (#35354)
## Summary
- Restores the trailing slash on \`/c/\` in
\`CMSUrlUtil.BACKEND_FILTERED_COLLECTION\` — one character change:
\`/c\` → \`/c/\`
- \`isVanityUrlFiltered()\` uses raw \`url.startsWith(prefix)\`, so
without the slash, prefix \`/c\` matches **any** URL beginning with the
letter "c" (e.g. \`/calculators\`, \`/contact\`, \`/customers\`),
causing \`VanityURLFilter\` to skip vanity URL resolution for those
paths entirely
- Confirmed broken in production on \`26.04.11-01_1007280\`, working on
\`26.03.27-01_73a99ad\`
## Root Cause
PR #35151 changed \`/c/\` to \`/c\` in \`BACKEND_FILTERED_COLLECTION\`.
The \`internalUrl()\` method added in that PR appends \`"/"\` before
calling \`startsWith()\` so it is safe — but the pre-existing
\`isVanityUrlFiltered()\` does not, making \`/c\` an overly broad prefix
that matches all \`c*\` URLs.
## Test plan
- [ ] Request a vanity URL whose URI starts with \`c\` (e.g.
\`/calculators/home-loan/mortgage-calculator\`) — should resolve
correctly instead of returning 404
- [ ] Request \`/c/<uuid>/fileAsset/...\` (content asset endpoint) —
should still be excluded as an internal URL
- [ ] Run \`CMSUrlUtilTest\` — two new regression tests cover both cases
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Daniel Silva <infoserveisaudiovisuals@Daniel-Silva-MBP-M2.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e8f92a1 commit 9650131
2 files changed
Lines changed: 26 additions & 1 deletion
File tree
- dotCMS/src
- main/java/com/dotmarketing/filters
- test/java/com/dotmarketing/filters
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
81 | 106 | | |
82 | 107 | | |
83 | 108 | | |
| |||
0 commit comments