Skip to content

Commit 8701d84

Browse files
authored
Fix middleware copying when creating new group
When creating new group when copying middlewares from parent router we loose some in the process. It seems that when allocating space for middlewares by mistake we allocate space for the NEW middlewares instead of the parent ones. This should fix the problem
1 parent 18f11ab commit 8701d84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (g *routeGroup) Group(prefix string, middleware ...Handler) IRouteGroup {
198198
return rg
199199
}
200200

201-
rg.middleware = make(HandlersChain, len(middleware))
201+
rg.middleware = make(HandlersChain, len(g.lars.middleware))
202202
copy(rg.middleware, g.lars.middleware)
203203
rg.Use(middleware...)
204204

0 commit comments

Comments
 (0)