From 7a6d080aaf48c6df2d433672a946610ae1cd53f3 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Sun, 7 Mar 2021 15:39:36 -0600 Subject: fix? --- csci4131/hw4/strap012/strap012.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csci4131/hw4/strap012/strap012.py b/csci4131/hw4/strap012/strap012.py index 71d0762..ff55926 100644 --- a/csci4131/hw4/strap012/strap012.py +++ b/csci4131/hw4/strap012/strap012.py @@ -21,13 +21,13 @@ def getContents(type, file): getContents(type, "403.html") else: if type == "HEAD" or "GET": - returnValue.join(OK.encode()) + returnValue = OK.encode() if type == "GET": - returnValue.join([content.read(), "{}{}".format(CRLF, CRLF).encode()]) + returnValue =b"".join([returnValue, content.read(), "{}{}".format(CRLF, CRLF).encode()]) elif type == "POST": print("B") else: - returnValue.join(METHOD_NOT_ALLOWED.encode()) + returnValue= METHOD_NOT_ALLOWED.encode() content.close() return returnValue @@ -39,7 +39,7 @@ def client_recv(client_sock, client_addr): request = data[0].split(" ") want = getContents(request[0], request[1][1:]) client_sock.send(want) - + print(want) client_sock.shutdown(1) client_sock.close() -- cgit v1.2.3