Skip to content

Commit 8c13b9d

Browse files
committed
Fixed sub-group virtual hosts
1 parent 46ae04b commit 8c13b9d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

echo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const (
225225

226226
const (
227227
// Version of Echo
228-
Version = "4.1.0"
228+
Version = "4.1.2"
229229
website = "https://echo.labstack.com"
230230
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
231231
banner = `

group.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ func (g *Group) Match(methods []string, path string, handler HandlerFunc, middle
9393
}
9494

9595
// Group creates a new sub-group with prefix and optional sub-group-level middleware.
96-
func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) *Group {
96+
func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) (sg *Group) {
9797
m := make([]MiddlewareFunc, 0, len(g.middleware)+len(middleware))
9898
m = append(m, g.middleware...)
9999
m = append(m, middleware...)
100-
return g.echo.Group(g.prefix+prefix, m...)
100+
sg = g.echo.Group(g.prefix+prefix, m...)
101+
sg.host = g.host
102+
return
101103
}
102104

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

0 commit comments

Comments
 (0)