增加、默认路由

This commit is contained in:
bjdgyc 2021-08-13 13:19:26 +08:00
parent 8187fb548f
commit 65463fee6c
2 changed files with 5 additions and 0 deletions

View File

@ -84,8 +84,10 @@ func SetGroup(g *Group) error {
for _, v := range g.RouteInclude {
if v.Val != "" {
if v.Val == "all" {
routeInclude = append(routeInclude, v)
continue
}
ipMask, _, err := parseIpNet(v.Val)
if err != nil {
return errors.New("RouteInclude 错误" + err.Error())

View File

@ -96,6 +96,9 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
}
// 允许的路由
for _, v := range cSess.Group.RouteInclude {
if v.Val == "all" {
continue
}
w.Header().Add("X-CSTP-Split-Include", v.IpMask)
}
// 不允许的路由