1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Merge branch 'currantlabs-corrupted_group_fix'

This commit is contained in:
Vishal Rana 2015-09-21 09:02:02 -07:00
commit d079d36162

View File

@ -414,7 +414,11 @@ func serveFile(dir, file string, c *Context) error {
func (e *Echo) Group(prefix string, m ...Middleware) *Group {
g := &Group{*e}
g.echo.prefix += prefix
if len(m) > 0 {
if len(m) == 0 {
mw := make([]MiddlewareFunc, len(g.echo.middleware))
copy(mw, g.echo.middleware)
g.echo.middleware = mw
} else {
g.echo.middleware = nil
g.Use(m...)
}