mirror of
https://github.com/labstack/echo.git
synced 2025-11-27 22:38:25 +02:00
Fixed sub-group virtual hosts
This commit is contained in:
2
echo.go
2
echo.go
@@ -225,7 +225,7 @@ const (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Version of Echo
|
// Version of Echo
|
||||||
Version = "4.1.0"
|
Version = "4.1.2"
|
||||||
website = "https://echo.labstack.com"
|
website = "https://echo.labstack.com"
|
||||||
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
|
// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo
|
||||||
banner = `
|
banner = `
|
||||||
|
|||||||
6
group.go
6
group.go
@@ -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.
|
// 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 := make([]MiddlewareFunc, 0, len(g.middleware)+len(middleware))
|
||||||
m = append(m, g.middleware...)
|
m = append(m, g.middleware...)
|
||||||
m = append(m, 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.
|
// Static implements `Echo#Static()` for sub-routes within the Group.
|
||||||
|
|||||||
Reference in New Issue
Block a user