summaryrefslogtreecommitdiffstats
path: root/Lib/http/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/http/server.py')
-rw-r--r--Lib/http/server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index 5e91826..de6b531 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -338,6 +338,13 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
HTTPStatus.BAD_REQUEST,
"Line too long")
return False
+ except http.client.HTTPException as err:
+ self.send_error(
+ HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE,
+ "Too many headers",
+ str(err)
+ )
+ return False
conntype = self.headers.get('Connection', "")
if conntype.lower() == 'close':