Skip to content

Commit

Permalink
Fixed sub-group virtual hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
vishr committed Apr 29, 2019
1 parent 46ae04b commit 8c13b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const (

const (
// Version of Echo
Version = "4.1.0"
Version = "4.1.2"
website = "https://echo.labstack.com"
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
banner = `
Expand Down
6 changes: 4 additions & 2 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ func (g *Group) Match(methods []string, path string, handler HandlerFunc, middle
}

// Group creates a new sub-group with prefix and optional sub-group-level middleware.
func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) *Group {
func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) (sg *Group) {
m := make([]MiddlewareFunc, 0, len(g.middleware)+len(middleware))
m = append(m, g.middleware...)
m = append(m, middleware...)
return g.echo.Group(g.prefix+prefix, m...)
sg = g.echo.Group(g.prefix+prefix, m...)
sg.host = g.host
return
}

// Static implements `Echo#Static()` for sub-routes within the Group.
Expand Down

0 comments on commit 8c13b9d

Please sign in to comment.