diff --git a/routergroup.go b/routergroup.go index 8afd29e9..74dc82f0 100644 --- a/routergroup.go +++ b/routergroup.go @@ -148,6 +148,9 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS func (group *RouterGroup) combineHandlers(handlers HandlersChain) HandlersChain { finalSize := len(group.Handlers) + len(handlers) + if finalSize >= AbortIndex { + panic("too many handlers") + } mergedHandlers := make(HandlersChain, finalSize) copy(mergedHandlers, group.Handlers) copy(mergedHandlers[len(group.Handlers):], handlers)