Skip to content

Commit fae3664

Browse files
committed
pythongh-127794: Revert the changes
1 parent 31e4f3e commit fae3664

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

Lib/email/message.py

-8
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,6 @@ def add_header(self, _name, _value, **_params):
564564
msg.add_header('content-disposition', 'attachment',
565565
filename='Fußballer.ppt'))
566566
"""
567-
# Validate header name according to RFC 5322
568-
if not _name or ' ' in _name or '\t' in _name or ':' in _name:
569-
raise ValueError(f"Invalid header field name {_name!r}")
570-
571-
# Only allow printable ASCII characters
572-
if any(ord(c) < 33 or ord(c) > 126 for c in _name):
573-
raise ValueError(f"Header field name {_name!r} contains invalid characters")
574-
575567
parts = []
576568
for k, v in _params.items():
577569
if v is None:

0 commit comments

Comments
 (0)