Open poqoid opened 4 years ago
Formerly, the code would run each element through quote_plus twice:
quote_plus
import asks test_data = [{'foo': 'abc', 'bar': 'jkl'}, {'foo': ['abc def', 'ghi'], 'bar baz': 'jkl'}] for row in test_data: print(asks.request_object.RequestProcessor._dict_to_query(row))
?foo=abc&bar=jkl ?foo=abc%252Bdef&foo=ghi&bar+baz=jkl
Note that %252B is + encoded twice:
%252B
+
>>> from urllib.parse import quote_plus >>> quote_plus('+') '%2B' >>> quote_plus('%2B') '%252B'
This pull request makes it so that each element is only encoded once.
Formerly, the code would run each element through
quote_plus
twice:Note that
%252B
is+
encoded twice:This pull request makes it so that each element is only encoded once.