1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00

Fixed sub-group virtual hosts

This commit is contained in:
Vishal Rana 2019-04-28 23:10:00 -07:00
parent 46ae04bef2
commit 8c13b9dae2
2 changed files with 5 additions and 3 deletions

View File

@ -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 = `

View File

@ -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.