This commit is contained in:
chrislusf
2015-10-19 22:03:18 -07:00
parent faaf44f171
commit 805740069a
2 changed files with 19 additions and 20 deletions

View File

@@ -4,8 +4,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"net" "net"
"regexp"
"net/http" "net/http"
"regexp"
"github.com/chrislusf/seaweedfs/go/glog" "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 // is a CIDR range, and we should check the
// remote host is within it // remote host is within it
match, _ := regexp.MatchString("/", ip) match, _ := regexp.MatchString("/", ip)
if ( match ) { if match {
_, cidrnet, err := net.ParseCIDR(ip) _, cidrnet, err := net.ParseCIDR(ip)
if err != nil { if err != nil {
panic(err) 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. // Otherwise we're looking for a literal match.
// //