net/mail: more liberal parsing of Date headers.

Fixes #3639.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6243045
This commit is contained in:
Bill Thiede 2012-05-25 09:19:21 +10:00 committed by David Symonds
parent d6ac5b32d2
commit 132dbb61aa
2 changed files with 11 additions and 5 deletions

View file

@ -95,6 +95,11 @@ func TestDateParsing(t *testing.T) {
"21 Nov 97 09:55:06 GMT",
time.Date(1997, 11, 21, 9, 55, 6, 0, time.FixedZone("GMT", 0)),
},
// Commonly found format not specified by RFC 5322.
{
"Fri, 21 Nov 1997 09:55:06 -0600 (MDT)",
time.Date(1997, 11, 21, 9, 55, 6, 0, time.FixedZone("", -6*60*60)),
},
}
for _, test := range tests {
hdr := Header{