|
|
@ -4,8 +4,8 @@ import ( |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"net" |
|
|
|
"regexp" |
|
|
|
"net/http" |
|
|
|
"regexp" |
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/go/glog" |
|
|
|
) |
|
|
@ -94,7 +94,7 @@ func (g *Guard) checkWhiteList(w http.ResponseWriter, r *http.Request) error { |
|
|
|
// is a CIDR range, and we should check the
|
|
|
|
// remote host is within it
|
|
|
|
match, _ := regexp.MatchString("/", ip) |
|
|
|
if ( match ) { |
|
|
|
if match { |
|
|
|
_, cidrnet, err := net.ParseCIDR(ip) |
|
|
|
if err != nil { |
|
|
|
panic(err) |
|
|
@ -105,7 +105,6 @@ func (g *Guard) checkWhiteList(w http.ResponseWriter, r *http.Request) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Otherwise we're looking for a literal match.
|
|
|
|
//
|
|
|
|