Skip to content

Commit 9a5c4ae

Browse files
committed
fix(mail): prevent whitespace in domain part of addr-spec
Updated the addrParser's consumeAddrSpec function to clarify that whitespace characters are not allowed in the domain part of an email address. Removed the call to skipSpace to enforce this rule.
1 parent 8282b72 commit 9a5c4ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/net/mail/message.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ func (p *addrParser) consumeAddrSpec() (spec string, err error) {
549549

550550
// domain = dot-atom / domain-literal
551551
var domain string
552-
p.skipSpace()
552+
// domain part does not allow whitespace characters, so skipSpace cannot be called here
553+
// p.skipSpace()
553554
if p.empty() {
554555
return "", errors.New("mail: no domain in addr-spec")
555556
}

0 commit comments

Comments
 (0)