Skip to content

Commit

Permalink
Merge pull request #2 from pimoroni/patch-form-parse
Browse files Browse the repository at this point in the history
server.py:_parse_query_string: split only on first "="
  • Loading branch information
lowfatcode authored Aug 8, 2022
2 parents 29909a5 + 751f38b commit 7ea5b9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phew/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def urldecode(text):
def _parse_query_string(query_string):
result = {}
for parameter in query_string.split("&"):
key, value = parameter.split("=")
key, value = parameter.split("=", 1)
key = urldecode(key)
value = urldecode(value)
result[key] = value
Expand Down Expand Up @@ -352,4 +352,4 @@ def run(host = "0.0.0.0", port = 80):

loop = uasyncio.get_event_loop()
loop.create_task(uasyncio.start_server(_handle_request, host, port))
loop.run_forever()
loop.run_forever()

0 comments on commit 7ea5b9b

Please sign in to comment.