Skip to content

Commit ebd47a4

Browse files
committed
Update the regex per review comments
1 parent 84d2aec commit ebd47a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/email/_policybase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
'compat32',
1616
]
1717

18-
header_ascii_re = re.compile("[\041-\071\073-\176]+$")
18+
valid_header_name_re = re.compile("[\041-\071\073-\176]+$")
1919

2020
def validate_header_name(name):
2121
# Validate header name according to RFC 5322
22-
if not header_ascii_re.match(name):
22+
if not valid_header_name_re.match(name):
2323
raise ValueError(f"Header field name contains invalid characters: {name!r}")
2424

2525
class _PolicyBase:

0 commit comments

Comments
 (0)