mirror of
https://github.com/golang/go
synced 2024-11-22 05:54:40 -07:00
net/mail: To4 is all we need
This commit is contained in:
parent
18675e7046
commit
dfa5f640b0
@ -756,7 +756,7 @@ func (p *addrParser) consumeDomainLiteral() (string, error) {
|
||||
return "", fmt.Errorf("mail: invalid IPv6 address in domain-literal: %q", dtext)
|
||||
}
|
||||
|
||||
} else if len(net.ParseIP(dtext).To4()) != net.IPv4len {
|
||||
} else if net.ParseIP(dtext).To4() != nil {
|
||||
// Check if the domain literal is an IP address
|
||||
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user