Update I2PAddr.go, fixes eyedeekay/onramp issue #2

This commit is contained in:
idk
2025-05-15 22:44:23 -04:00
committed by GitHub
parent 9694fe011c
commit d166f5c31e

View File

@ -60,6 +60,10 @@ func sanitizeAddress(addr string) string {
}
func validateAddressFormat(addr string) error {
host, _, err := net.SplitHostPort(addr)
if host != "" {
addr = host
}
if len(addr) > MaxAddressLength || len(addr) < MinAddressLength {
return fmt.Errorf("invalid address length: got %d, want between %d and %d",
len(addr), MinAddressLength, MaxAddressLength)