Repository navigation
Commit 40c22f4
authored
docs(group): explain how group catch-all NotFound routes replace RouteNotFound handlers (#3155)
When a group has middlewares, `Group#Use()` registers catch-all NotFound routes for the group prefix and prefix + `/*` so the middlewares also run for unmatched paths. This is by design (#2411), but the `Group.RouteNotFound` doc did not say so.
The note documents which calls register these routes, that the last registered NotFound route for a path wins with only the group middlewares it was registered with, where to register custom handlers, and what to do on routers that do not allow overwriting routes.
Refs #31531 parent bbc6de8 commit 40c22f4
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| |||
0 commit comments