fixed client ip

This commit is contained in:
ston1th 2023-03-23 00:14:26 +01:00
commit c565dd5ece
2 changed files with 11 additions and 2 deletions

View file

@ -5,6 +5,12 @@
package types package types
import "net"
func clientip(ip string) string { func clientip(ip string) string {
if ip == "@" {
return ip return ip
}
host, _, _ := net.SplitHostPort(ip)
return host
} }

View file

@ -5,9 +5,12 @@
package types package types
import "net"
func clientip(ip string) string { func clientip(ip string) string {
if ip == "" { if ip == "" {
return "@" return "@"
} }
return ip host, _, _ := net.SplitHostPort(ip)
return host
} }