Issue #26586: Merge excessive HTTP header handling from 3.5

This commit is contained in:
Martin Panter 2016-04-03 01:28:49 +00:00
commit b93e4b2480
3 changed files with 18 additions and 0 deletions

View file

@ -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':