Skip to content

Commit

Permalink
client: allow using utf-8 usernames and passwords (#567)
Browse files Browse the repository at this point in the history
* client: allow using utf-8 usernames and passwords

It looks like requests supports utf-8, but only if it is pre-encoded by the caller. Otherwise, it tries to encode both parameters using latin-1.

See
https://github.com/psf/requests/blob/a3ce6f007597f14029e6b6f54676c34196aa050e/src/requests/auth.py#L56-L60
psf/requests#3662
pallets/werkzeug#945
  • Loading branch information
bendem authored Aug 29, 2024
1 parent 8791299 commit 1b90247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ara/clients/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_client(
"""
auth = None
if username is not None and password is not None:
auth = HTTPBasicAuth(username, password)
auth = HTTPBasicAuth(username.encode("utf-8"), password.encode("utf-8"))

# Verify can be a bool (to ignore SSL verification or not)
# or the path to a certificate authority
Expand Down

0 comments on commit 1b90247

Please sign in to comment.