From 735e9e867af23acfbe8eca9ea2e546542d65e8c9 Mon Sep 17 00:00:00 2001 From: Ben Kallus Date: Mon, 4 Dec 2023 17:08:16 -0500 Subject: [PATCH] Disallow empty header names. --- gunicorn/http/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 0006fa61..11ee4d15 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -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: