mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 08:40:26 +08:00
“系统设置 -- 安全管理”里可以单独添加允许访问的IP
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user