This commit is contained in:
1 parent
e372ef336d
commit
1c8dd338f8
2 files changed
+8
-1
No files matched your search
@@ -409,7 +409,13 @@ func listen(addr string) {
|
||||
}
|
||||
|
||||
// check is ip
|
||||
ip := net.ParseIP(remoteAddr.String())
|
||||
remoteAddrStr := remoteAddr.String()
|
||||
// remove port with IPv6 support
|
||||
if strings.Contains(remoteAddrStr, ":") {
|
||||
remoteAddrStr = remoteAddrStr[:strings.LastIndex(remoteAddrStr, ":")]
|
||||
}
|
||||
|
||||
ip := net.ParseIP(remoteAddrStr)
|
||||
if ip == nil {
|
||||
log.Warnf("Got request from non-IP %s, ignoring request", remoteAddr)
|
||||
_ = conn.Close()
|
||||
|
||||
Reference in new issue
Block a user