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:
parent
2f0acc1e80
commit
73b8baa1bd
@ -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.
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user