diff options
author | RossTheRoss <mstrapp@protonmail.com> | 2021-03-07 15:39:36 -0600 |
---|---|---|
committer | RossTheRoss <mstrapp@protonmail.com> | 2021-03-07 15:39:36 -0600 |
commit | 7a6d080aaf48c6df2d433672a946610ae1cd53f3 (patch) | |
tree | 2ada7d24a721e2953d7dd829480f95647e635fe8 /csci4131 | |
parent | aaaaaaaaaaaaaaaaaaaaa (diff) | |
download | homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar.gz homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar.bz2 homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar.lz homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar.xz homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.tar.zst homework-7a6d080aaf48c6df2d433672a946610ae1cd53f3.zip |
fix?
Diffstat (limited to 'csci4131')
-rw-r--r-- | csci4131/hw4/strap012/strap012.py | 8 |
1 files 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() |