Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
strip inserts
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Nov 11, 2023
1 parent 6ba2c54 commit 60805fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ def play():
query = b""
else:
query = query.encode('utf-8')

if body is not None:
query = query + "\n".encode('utf-8') + body
data = f""
request_lines = body.decode('utf-8').strip().splitlines(True)
for line in request_lines:
data += line.strip()
body = data.encode('utf-8')
query = query + " ".encode('utf-8') + body

if not query:
return "Error: no query parameter provided", 400
Expand Down

0 comments on commit 60805fb

Please sign in to comment.