getEncodedPassword: simplify encodedPassword return

This commit is contained in:
Adrien Delorme 2020-07-27 10:33:39 +02:00 committed by GitHub
parent 395a0c472e
commit c34e89aec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -148,8 +148,7 @@ func getEncodedPassword(u *url.URL) (string, bool) {
// filter password from all logging // filter password from all logging
password, passwordSet := u.User.Password() password, passwordSet := u.User.Password()
if passwordSet && password != "" { if passwordSet && password != "" {
encodedUserPassword := strings.Split(u.User.String(), ":") encodedPassword := strings.Split(u.User.String(), ":")[1]
encodedPassword := encodedUserPassword[len(encodedUserPassword)-1]
return encodedPassword, true return encodedPassword, true
} }
return password, false return password, false