mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fix Issue6791 - Limit the HTTP header readline with _MAXLENGTH. Patch by Antoine Pitrou
This commit is contained in:
parent
32e1771daf
commit
5466bf1c94
4 changed files with 67 additions and 8 deletions
|
@ -314,8 +314,12 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
|||
self.command, self.path, self.request_version = command, path, version
|
||||
|
||||
# Examine the headers and look for a Connection directive.
|
||||
self.headers = http.client.parse_headers(self.rfile,
|
||||
_class=self.MessageClass)
|
||||
try:
|
||||
self.headers = http.client.parse_headers(self.rfile,
|
||||
_class=self.MessageClass)
|
||||
except http.client.LineTooLong:
|
||||
self.send_error(400, "Line too long")
|
||||
return False
|
||||
|
||||
conntype = self.headers.get('Connection', "")
|
||||
if conntype.lower() == 'close':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue