This commit is contained in:
Roberto Polli 2023-11-30 09:58:42 +02:00 committed by GitHub
commit e834e03c83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

1
news/9973.bugfix.rst Normal file
View File

@ -0,0 +1 @@
Mask the user when the password is empty.

View File

@ -507,12 +507,13 @@ def redact_netloc(netloc: str) -> str:
For example:
- "user:pass@example.com" returns "user:****@example.com"
- "user:@example.com" returns "****@example.com"
- "accesstoken@example.com" returns "****@example.com"
"""
netloc, (user, password) = split_auth_from_netloc(netloc)
if user is None:
return netloc
if password is None:
if not password:
user = "****"
password = ""
else: