summaryrefslogtreecommitdiffstats
path: root/Lib/wsgiref/simple_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/wsgiref/simple_server.py')
-rw-r--r--Lib/wsgiref/simple_server.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py
index cd9751a..378b316 100644
--- a/Lib/wsgiref/simple_server.py
+++ b/Lib/wsgiref/simple_server.py
@@ -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