Skip to content

Commit 4d27fe2

Browse files
fulltimelinksjqzhang
authored andcommitted
解决adminIP不能使用ip的问题
len(strings.Split(v, "/")) > 0 在string 不为空时,恒为true
1 parent 0b8e76a commit 4d27fe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fileserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ func (this *Server) IsPeer(r *http.Request) bool {
18761876
return true
18771877
}
18781878
for _, v := range Config().AdminIps {
1879-
if len(strings.Split(v, "/")) > 0 {
1879+
if strings.Contains(v, "/") {
18801880
if _, cidr, err = net.ParseCIDR(v); err != nil {
18811881
log.Error(err)
18821882
return false

0 commit comments

Comments
 (0)