Skip to content

Commit a747eea

Browse files
committed
unquote url-encoded body
1 parent 4be3457 commit a747eea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autorequests/classes/body.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
2+
import urllib.parse
33

44
class Body:
55

@@ -86,7 +86,9 @@ def __parse_json(self):
8686
def __parse_urlencoded(self):
8787
# urllib.parse.parse_qs doesn't work here btw
8888
# if a key doesn't have a value then it gets excluded with parse_qs
89-
for param in self.body.split("&"):
89+
# not sure if unquote_plus() would be better
90+
body = urllib.parse.unquote(self.body)
91+
for param in body.split("&"):
9092
key, value = param.split("=", maxsplit=1)
9193
self.__data[key] = value
9294

0 commit comments

Comments
 (0)