copy mw len fix

This commit is contained in:
2025-08-16 18:20:24 +05:30
parent 216fe93a55
commit 5885b42816
2 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ func (m *Mux) Resource(pattern string, fn func(res *Resource), mw ...func(http.H
}
// Copy root middlewares.
mws := make([]func(http.Handler) http.Handler, 0, len(m.middlewares)+len(mw))
mws := make([]func(http.Handler) http.Handler, len(m.middlewares)+len(mw))
copy(mws, m.middlewares)
// Append inline middlewares.