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

Incorrect parsing of query parameters with %3B (;) inside #34

Closed
shturman opened this issue Dec 2, 2016 · 9 comments
Closed

Incorrect parsing of query parameters with %3B (;) inside #34

shturman opened this issue Dec 2, 2016 · 9 comments

Comments

@shturman
Copy link

shturman commented Dec 2, 2016

Some test below:

u = yarl.URL('/?user_agent=Mozilla%2F5.0+%28iPhone%3B+CPU+iPhone+OS+10_1_1+like+Mac+OS+X%29+AppleWebKit%2F602.2.14+%28KHTML%2C+like+Gecko%29+Mobile%2F14B100')
assert len(u.query.items()) == 1

But I'm getting 2 params.

@asvetlov
Copy link
Member

asvetlov commented Dec 2, 2016

I don't follow where do you have two params?

@shturman
Copy link
Author

shturman commented Dec 2, 2016

assert is failing due to

len(u.query.items()) == 2

@asvetlov
Copy link
Member

asvetlov commented Dec 2, 2016

Got it.
Thank you for report

@asvetlov
Copy link
Member

asvetlov commented Dec 3, 2016

Well, that's how urllib.parse.parse_sql works: split on both & and ;.

Not sure if this behavior should be fixed.

@shturman
Copy link
Author

shturman commented Dec 3, 2016

But that's why ';' was encoded with %3B.
The same way I can encode '&' with %26 and it works perfect. But with ';' is not.

len(yarl.URL('/?a=one%3Btwo').query) != len(urllib.parse.parse_qsl('a=one%3Btwo'))

@asvetlov
Copy link
Member

asvetlov commented Dec 3, 2016

Sorry for my stupidity.
I'll fix it ASAP.

@shturman
Copy link
Author

shturman commented Dec 3, 2016

np

@shturman
Copy link
Author

shturman commented Jan 4, 2017

Any updates on this issue? aiohttp query parsing works incorrectly due to it (

@fafhrd91
Copy link
Member

fafhrd91 commented Feb 7, 2017

i will push new release today

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

No branches or pull requests

3 participants