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

Use .raw_host instead of slower .host in client API #4402

Merged
merged 2 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/4402.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use .raw_host instead of slower .host in client API
4 changes: 2 additions & 2 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def connection_key(self) -> ConnectionKey:

@property
def host(self) -> str:
ret = self.url.host
ret = self.url.raw_host
assert ret is not None
return ret

Expand All @@ -283,7 +283,7 @@ def request_info(self) -> RequestInfo:
def update_host(self, url: URL) -> None:
"""Update destination host, port and connection type (ssl)."""
# get host/port
if not url.host:
if not url.raw_host:
raise InvalidURL(url)

# basic auth info
Expand Down