We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfa5f64 commit 4bc6a36Copy full SHA for 4bc6a36
src/net/mail/message.go
@@ -751,13 +751,13 @@ func (p *addrParser) consumeDomainLiteral() (string, error) {
751
return "", errors.New("mail: unclosed domain-literal")
752
}
753
754
+ // Check if the domain literal is an IP address
755
if addr, ok := strings.CutPrefix(dtext, "IPv6:"); ok {
756
if len(net.ParseIP(addr)) != net.IPv6len {
757
return "", fmt.Errorf("mail: invalid IPv6 address in domain-literal: %q", dtext)
758
759
760
} else if net.ParseIP(dtext).To4() != nil {
- // Check if the domain literal is an IP address
761
return "", fmt.Errorf("mail: invalid IP address in domain-literal: %q", dtext)
762
763
0 commit comments