fix: disable echo group 404 auto-registration to keep pre-5.3.0 routing behavior

echo v5.3.0 reverted to v4 behavior where every group with middleware
implicitly registers a 404 route at its prefix. Our route setup creates
multiple groups with the same prefix (rate-limit subgroups of /api/v1),
which now panics with a duplicate-route error at startup.
This commit is contained in:
kolaente
2026-07-18 17:24:51 +00:00
committed by kolaente
parent 293ac5d103
commit f76e405b6c
+4
View File
@@ -133,6 +133,10 @@ func NewEcho() *echo.Echo {
Router: echo.NewRouter(echo.RouterConfig{
UnescapePathParamValues: true,
}),
// Since echo v5.3.0 groups implicitly register 404 routes when middleware
// is added. Our route setup creates multiple groups with the same prefix
// (e.g. rate-limit subgroups of /api/v1), which would panic as duplicates.
NoGroupAutoRegister404Routes: true,
})
// Configure IP extraction to prevent rate limit bypass via spoofed headers.