mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Merge from 3.3
Issue #22419: Limit the length of incoming HTTP request in wsgiref server to 65536 bytes.
This commit is contained in:
commit
86c9e1877c
4 changed files with 18 additions and 1 deletions
|
|
@ -115,7 +115,14 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
|
|||
def handle(self):
|
||||
"""Handle a single HTTP request"""
|
||||
|
||||
self.raw_requestline = self.rfile.readline()
|
||||
self.raw_requestline = self.rfile.readline(65537)
|
||||
if len(self.raw_requestline) > 65536:
|
||||
self.requestline = ''
|
||||
self.request_version = ''
|
||||
self.command = ''
|
||||
self.send_error(414)
|
||||
return
|
||||
|
||||
if not self.parse_request(): # An error code has been sent, just exit
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue