Commit f41c6d2
committed
Keep deprecated Router.route() a nullable probe
Callers using the deprecated `Router` from
`@fedify/fedify/federation` could pass arbitrary strings, including
absolute URLs or otherwise non-path inputs, and get `null` back when
they did not match. After the switch to `@fedify/uri-template`, the
`assertPath(url)` call made the same probing code throw `RouterError`
instead.
Since this class is still the deprecated compatibility surface and
this change ships in a minor release, that is a compatibility
regression rather than a migration nudge. Replace `assertPath(url)`
with an `isPath(url)` guard so `route()` again returns `null` for
non-path inputs, while the underlying `@fedify/uri-template` router
stays strict. `add()` is left throwing because the old
`Router.add()` also threw on invalid templates.
#758 (comment)
#418
Assisted-by: Claude Code:claude-opus-4-71 parent e646fcc commit f41c6d2
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | | - | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
0 commit comments