Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with_query autoencode unexpected result #426

Closed
dimaqq opened this issue Mar 2, 2020 · 0 comments · Fixed by #472
Closed

with_query autoencode unexpected result #426

dimaqq opened this issue Mar 2, 2020 · 0 comments · Fixed by #472

Comments

@dimaqq
Copy link

dimaqq commented Mar 2, 2020

I've ran into this when some external service sent an escaped character:

In [16]: str(URL("/").with_query(foo="bar&baz%26qux"))
Out[16]: '/?foo=bar%26baz%26qux'

The distinction between inputs & and %26 is lost:

In [19]: URL(x).query
Out[19]: <MultiDictProxy('foo': 'bar&baz&qux')>

This makes the library hard to use for arbitrary input.

The specific case where yarl broke involved 2 redirects (i.e. nested) where each had own query parameters.

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

Successfully merging a pull request may close this issue.

1 participant