mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
RFC 2822 describes the characters allowed in a header field name. Conform to
this, and add test cases.
This commit is contained in:
parent
e48bad7a24
commit
f4c7c402d4
2 changed files with 19 additions and 1 deletions
|
@ -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'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue