Skip to content

Commit

Permalink
Update yarl/_url.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Sep 26, 2024
1 parent 6401a10 commit 59dbfe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def host(self) -> Union[str, None]:
"""
if (raw := self.raw_host) is None:
return None
if raw and (":" in raw or raw[-1].isdigit()):
if raw and raw[-1].isdigit() or ":" in raw:
# IP addresses are never IDNA encoded
return raw
return _idna_decode(raw)
Expand Down

0 comments on commit 59dbfe4

Please sign in to comment.