middleware.CleanPath doesn't work with other routers
Open
- Dominant language
- Go
- Stars
- 22.8k
- Forks
- 1.2k
- Avg merge
- 5h 17m
- Merged PRs (30d)
- 10
Description
The rctx is not checked and could be nil if the function isn't used with a chi.Router.
It ends up in a panic.
PR: #786
Additional point: the cleaning only happens in the rctx.RoutePath is an empty string. If a function like [GetHead](https://github.com/go-chi/chi/blob/v1.5.4/middleware/get_head.go#L10) [¶](https://pkg.go.dev/github.com/go-chi/chi/middleware#GetHead) is called before it won't clean the path.
Contributor guide
Assessment
This issue has not been assessed yet.