mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
d6ac5b32d2
commit
132dbb61aa
2 changed files with 11 additions and 5 deletions
|
|
@ -69,11 +69,12 @@ var dateLayouts []string
|
|||
func init() {
|
||||
// Generate layouts based on RFC 5322, section 3.3.
|
||||
|
||||
dows := [...]string{"", "Mon, "} // day-of-week
|
||||
days := [...]string{"2", "02"} // day = 1*2DIGIT
|
||||
years := [...]string{"2006", "06"} // year = 4*DIGIT / 2*DIGIT
|
||||
seconds := [...]string{":05", ""} // second
|
||||
zones := [...]string{"-0700", "MST"} // zone = (("+" / "-") 4DIGIT) / "GMT" / ...
|
||||
dows := [...]string{"", "Mon, "} // day-of-week
|
||||
days := [...]string{"2", "02"} // day = 1*2DIGIT
|
||||
years := [...]string{"2006", "06"} // year = 4*DIGIT / 2*DIGIT
|
||||
seconds := [...]string{":05", ""} // second
|
||||
// "-0700 (MST)" is not in RFC 5322, but is common.
|
||||
zones := [...]string{"-0700", "MST", "-0700 (MST)"} // zone = (("+" / "-") 4DIGIT) / "GMT" / ...
|
||||
|
||||
for _, dow := range dows {
|
||||
for _, day := range days {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue