getEncodedPassword: simplify encodedPassword return

pull/9649/head
Adrien Delorme 6 years ago committed by GitHub
parent 395a0c472e
commit c34e89aec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save