“系统设置 -- 安全管理”里可以单独添加允许访问的IP

This commit is contained in:
GoEdgeLab
2021-03-28 15:50:28 +08:00
parent a2bd1af9f2
commit 55a92b05c4
4 changed files with 43 additions and 0 deletions

View File

@@ -89,6 +89,16 @@ func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bo
}
}
// 检查单独允许的IP
if len(config.AllowIPRanges()) > 0 {
for _, r := range config.AllowIPRanges() {
if r.Contains(ipAddr) {
return true
}
}
return false
}
return true
}