aboutsummaryrefslogtreecommitdiffstats
path: root/csci4131/hw4/strap012
diff options
context:
space:
mode:
Diffstat (limited to 'csci4131/hw4/strap012')
-rw-r--r--csci4131/hw4/strap012/MyForm.html2
-rw-r--r--csci4131/hw4/strap012/strap012.py15
2 files changed, 8 insertions, 9 deletions
diff --git a/csci4131/hw4/strap012/MyForm.html b/csci4131/hw4/strap012/MyForm.html
index 435965b..4000667 100644
--- a/csci4131/hw4/strap012/MyForm.html
+++ b/csci4131/hw4/strap012/MyForm.html
@@ -19,7 +19,7 @@
</table>
</nav><br>
<h2>Simple Form</h2>
- <form action="http://www-users.cselabs.umn.edu/~joh13266/echo.php/" method="post">
+ <form action="http://localhost:9001" method="post">
<p class="Form">
<label>Name:
<input name="name" pattern="[A-za-z0-9]+" required title="Contact's name must be alphanumeric." type="text" size="25" maxlength="30" id="name"><br><br>
diff --git a/csci4131/hw4/strap012/strap012.py b/csci4131/hw4/strap012/strap012.py
index 469be81..f498222 100644
--- a/csci4131/hw4/strap012/strap012.py
+++ b/csci4131/hw4/strap012/strap012.py
@@ -37,14 +37,13 @@ def getContents(type, file):
returnValue = b"".join(
[returnValue, forb.read(), "{}{}".format(CRLF, CRLF).encode()])
else:
- if type == "HEAD" or "GET":
- returnValue = OK.encode()
- if type == "GET":
- returnValue = b"".join(
- [returnValue, content.read(), "{}{}".format(CRLF, CRLF).encode()])
- else:
- returnValue = b"".join(
- [returnValue, "{}{}".format(CRLF, CRLF).encode()])
+ returnValue = OK.encode()
+ if type == "HEAD":
+ returnValue = b"".join(
+ [returnValue, "{}{}".format(CRLF, CRLF).encode()])
+ elif type == "GET":
+ returnValue = b"".join(
+ [returnValue, content.read(), "{}{}".format(CRLF, CRLF).encode()])
elif type == "POST":
print("B")
else: