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

Added IPv6 address support in ClientRequest.update_host #425

Merged
merged 2 commits into from
Jun 26, 2015

Conversation

ffix
Copy link
Contributor

@ffix ffix commented Jun 26, 2015

Current version of aiohttp doesn't support ipv6 addresses in url (like http://[2001:db8::1]/). It fails with exception here.

This pull request should fix it.

@@ -97,41 +97,45 @@ def __init__(self, method, url, *,

def update_host(self, url):
"""Update destination host, port and connection type (ssl)."""
scheme, netloc, path, query, fragment = urllib.parse.urlsplit(url)
scheme, netloc, path, query, fragment = \
url_parsed = urllib.parse.urlsplit(url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make code simpler:

url_parsed = urllib.parse.urlsplit(url)
scheme, netloc, path, query, fragment = url_parsed

One-liners are not always the best solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even drop second line from my previous comment and use url_parsed everywhere in the method.

asvetlov added a commit that referenced this pull request Jun 26, 2015
Added IPv6 address support in ClientRequest.update_host
@asvetlov asvetlov merged commit fd119b9 into aio-libs:master Jun 26, 2015
@asvetlov
Copy link
Member

Perfect! Thanks!

@lock
Copy link

lock bot commented Oct 30, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants