fix: fixing server issues

This commit is contained in:
Elias Renman
2023-06-20 22:27:42 +02:00
parent f4c3ce6a01
commit dc692c0fde
9 changed files with 1120 additions and 55 deletions

View File

@@ -71,11 +71,11 @@ def get_body(request: str):
for index in range(len(req)):
item = req[index]
if item.find("Content-Type") != -1:
if item.lower().find("content-type") != -1:
if not item.find("application/json"):
return
if item.find("Content-Length") != -1:
if item.lower().find("content-length") != -1:
content_length_index = index
if index > content_length_index:
@@ -83,6 +83,7 @@ def get_body(request: str):
out = out.replace("\n", "")
out = out.replace("\t", "")
print("Output", out)
if out != "":
return out