You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: make Router.Route() idempotent on duplicate patterns
Calling r.Route(pattern, ...) twice on the same parent now attaches the
second block to the existing chi sub-mux via an isolated chi.Group
instead of panicking. This enables the common pattern of splitting
routes for a resource across blocks with different middleware scopes
(e.g. read vs. write API key scopes).
Each block runs inside its own chi.Group, so Use() inside a block only
applies to that block's handlers. Group() now shares its parent's
subroutes map so nested Route() calls dedup correctly across sibling
blocks.
Signed-off-by: Ahmed Kamal <ahmed@ahmedkamal.io>