mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/mail: fix wrong error message in consumePhrase
Fixes #19415 Change-Id: I6414f82e42bd09f1793156befce326aeac919ea2 Reviewed-on: https://go-review.googlesource.com/37911 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
c797256a8f
commit
2bd6360e3b
2 changed files with 2 additions and 1 deletions
|
|
@ -393,7 +393,7 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
|
|||
var word string
|
||||
p.skipSpace()
|
||||
if p.empty() {
|
||||
return "", errors.New("mail: missing phrase")
|
||||
break
|
||||
}
|
||||
isEncoded := false
|
||||
if p.peek() == '"' {
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ func TestAddressParsingError(t *testing.T) {
|
|||
4: {"\"\\" + string([]byte{0x80}) + "\" <escaped-invalid-unicode@example.net>", "invalid utf-8 in quoted-string"},
|
||||
5: {"\"\x00\" <null@example.net>", "bad character in quoted-string"},
|
||||
6: {"\"\\\x00\" <escaped-null@example.net>", "bad character in quoted-string"},
|
||||
7: {"John Doe", "no angle-addr"},
|
||||
}
|
||||
|
||||
for i, tc := range mustErrTestCases {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue