Skip to content

Commit

Permalink
Simplify processing of username and password for unencoded URLs (#1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 15, 2024
1 parent affe81c commit ca9f47a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def __new__(
else:
host = ""
host = cls._encode_host(host, validate_host=False)
raw_user = None if username is None else cls._REQUOTER(username)
raw_password = None if password is None else cls._REQUOTER(password)
raw_user = cls._REQUOTER(username) if username else username
raw_password = cls._REQUOTER(password) if password else password
netloc = cls._make_netloc(raw_user, raw_password, host, port)
# Remove brackets as host encoder adds back brackets for IPv6 addresses
cache["raw_host"] = host[1:-1] if "[" in host else host
Expand Down

0 comments on commit ca9f47a

Please sign in to comment.