-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Query parameters didn't get fully encoded #245
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
@rominf I found your issue here after filing a very similar one at #301. My hunch about this behavior is that it is actually
This means that My own confusion from this arose from the fact that >>> import urllib.parse
>>> query = {'response_type': 'code', 'client_id': 'bEjgr4rUka8Oswy', 'redirect_uri': 'http://172.25.210.184/authorized?state=e8be712d-3858-4549-86b2-60cea46c7396'}
>>> urllib.parse.urlencode(query)
'response_type=code&client_id=bEjgr4rUka8Oswy&redirect_uri=http%3A%2F%2F172.25.210.184%2Fauthorized%3Fstate%3De8be712d-3858-4549-86b2-60cea46c7396' What it all comes down to is that
|
For a different discussion see: psf/requests#794 |
Not escaping the ? in query arguments is causing many web servers to reject the connections (I crawl >100.000 pages on more than >10.000 web servers through aiohttp which uses yarl intensively). The standard does not force "?" from being encoded but does not forbid it either. Consequently, there are 2 alternatives which are standard-compliant and not one. Of these 2, the only alternative that seems webservers-compatible is to always encode it. |
Another concrete case of this documented here: aio-libs/aiohttp#5319 (comment) |
When I build an URL with
yarl.URL.build
I get the URL with partly encoded query::
,/
,?
are not encoded, as you see.The text was updated successfully, but these errors were encountered: