From 271b8657db0b070e63f8b533be5b5d75187582ed Mon Sep 17 00:00:00 2001 From: Peter Jung <88238335+rockystone77@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:12:22 +0900 Subject: [PATCH] Update server.py to catch 400 error This would stop the no header situation so catch it here. --- cheroot/server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cheroot/server.py b/cheroot/server.py index 91564611c0..53896e7064 100644 --- a/cheroot/server.py +++ b/cheroot/server.py @@ -732,6 +732,12 @@ def parse_request(self): 'allowed bytes.', ) return + except ValueError: + self.simple_response( + '400 Bad request', + 'Invalid Content Header.', + ) + return else: if not success: return