Disallow empty header names.

This commit is contained in:
Ben Kallus 2023-12-04 17:08:16 -05:00 committed by Paul J. Dorn
parent 2dbe49de99
commit 735e9e867a

View File

@ -83,7 +83,7 @@ class Message(object):
# Parse initial header name : value pair.
curr = lines.pop(0)
header_length = len(curr)
if curr.find(":") < 0:
if curr.find(":") <= 0:
raise InvalidHeader(curr.strip())
name, value = curr.split(":", 1)
if self.cfg.strip_header_spaces: