fix: call routegroup's register route directly in handle subpath

This commit is contained in:
Levente Nas
2024-11-08 20:34:32 +01:00
parent 1e48fa46cc
commit e24dc1b377

View File

@@ -136,8 +136,8 @@ func (rg *RouteGroup) Handle(method string, path string, handler http.Handler) {
rg.HandleFunc(method, path, handler.ServeHTTP)
}
func (rg *RouteGroup) HandleSubpath(path string, handler http.Handler) {
rg.mux.Handle(path, handler)
func (rg *RouteGroup) SubpathHandle(path string, handler http.Handler) {
rg.registerRoute("", path, handler.ServeHTTP)
}
func (rg *RouteGroup) GET(path string, handler http.Handler) {