1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:10:22 -07:00

net/mail: AddressList fails to parse addresses with a dot

Fixes #4938.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12657044
This commit is contained in:
Ryan Slade 2013-08-08 10:00:24 -07:00 committed by Brad Fitzpatrick
parent 2f0acc1e80
commit 73b8baa1bd
2 changed files with 11 additions and 1 deletions

View File

@ -342,7 +342,7 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
word, err = p.consumeQuotedString()
} else {
// atom
word, err = p.consumeAtom(false)
word, err = p.consumeAtom(true)
}
// RFC 2047 encoded-word starts with =?, ends with ?=, and has two other ?s.

View File

@ -225,6 +225,16 @@ func TestAddressParsing(t *testing.T) {
},
},
},
// Custom example with "." in name. For issue 4938
{
`Asem H. <noreply@example.com>`,
[]*Address{
{
Name: `Asem H.`,
Address: "noreply@example.com",
},
},
},
}
for _, test := range tests {
if len(test.exp) == 1 {