Skip to content

Conversation

@poqoid
Copy link

@poqoid poqoid commented Jan 23, 2020

Formerly, the code would run each element through quote_plus twice:

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:

>>> 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant