diff options
author | Barry Warsaw <barry@python.org> | 2004-11-29 03:46:54 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2004-11-29 03:46:54 (GMT) |
commit | f4c7c402d4944c3e1ff1a83925d5e11549ff4e36 (patch) | |
tree | 0f751939c916dec67d2c6d5a7d974440e3eb3594 /Lib/email/FeedParser.py | |
parent | e48bad7a24d5bc6cd1677d94ac669009d561744a (diff) | |
download | cpython-f4c7c402d4944c3e1ff1a83925d5e11549ff4e36.zip cpython-f4c7c402d4944c3e1ff1a83925d5e11549ff4e36.tar.gz cpython-f4c7c402d4944c3e1ff1a83925d5e11549ff4e36.tar.bz2 |
RFC 2822 describes the characters allowed in a header field name. Conform to
this, and add test cases.
Diffstat (limited to 'Lib/email/FeedParser.py')
-rw-r--r-- | Lib/email/FeedParser.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/email/FeedParser.py b/Lib/email/FeedParser.py index 690b7c2..f514728 100644 --- a/Lib/email/FeedParser.py +++ b/Lib/email/FeedParser.py @@ -27,7 +27,9 @@ NLCRE = re.compile('\r\n|\r|\n') NLCRE_bol = re.compile('(\r\n|\r|\n)') NLCRE_eol = re.compile('(\r\n|\r|\n)$') NLCRE_crack = re.compile('(\r\n|\r|\n)') -headerRE = re.compile(r'^(From |[-\w]{2,}:|[\t ])') +# RFC 2822 $3.6.8 Optional fields. ftext is %d33-57 / %d59-126, Any character +# except controls, SP, and ":". +headerRE = re.compile(r'^(From |[\041-\071\073-\176]{2,}:|[\t ])') EMPTYSTRING = '' NL = '\n' |