-
Notifications
You must be signed in to change notification settings - Fork 165
Open
Description
Line 41 in a2e08c1
| return u.Host, u.User.String() |
u.User.String()
// String returns the encoded userinfo information in the standard form
// of "username[:password]".
func (u *Userinfo) String() string {
if u == nil {
return ""
}
s := escape(u.username, encodeUserPassword)
if u.passwordSet {
s += ":" + escape(u.password, encodeUserPassword)
}
return s
}special characters will be escaped.
diff --git a/cmd/libs.go b/cmd/libs.go
index e8d6c7c..df29f80 100644
--- a/cmd/libs.go
+++ b/cmd/libs.go
@@ -38,7 +38,11 @@ func redisParsePath(path string) (addr, auth string) {
log.PanicErrorf(err, "invalid redis address %q", path)
}
if u.User != nil {
- return u.Host, u.User.String()
+ password, err := url.QueryUnescape(u.User.String())
+ if err != nil {
+ log.PanicErrorf(err, "invalid redis password %q", path)
+ }
+ return u.Host, password
} else {
return u.Host, ""
}Metadata
Metadata
Assignees
Labels
No labels