make sure we send all the data

This commit is contained in:
Jakob Ketterl 2021-08-03 15:03:20 +02:00
parent 52df289230
commit 66492ff40a
1 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,9 @@ class Controller(object):
self.handler.end_headers()
if type(content) == str:
content = content.encode()
self.handler.wfile.write(content)
while len(content):
w = self.handler.wfile.write(content)
content = content[w:]
def send_redirect(self, location, code=303):
self.handler.send_response(code)