Skip to content

Commit bb82134

Browse files
author
zhongming Fan
committed
fix: correct URL userinfo handling for DM driver by preserving special characters
1 parent 876d9b8 commit bb82134

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

exporter.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,8 @@ func buildDMUserinfo() string {
399399
if rawUser == "" {
400400
return ""
401401
}
402-
if rawPassword == "" {
403-
return url.UserPassword(rawUser, "").String()
404-
}
405-
return fmt.Sprintf("%s:%s", url.User(rawUser).String(), url.PathEscape(rawPassword))
402+
// DM 驱动不会对 userinfo 做 URL 解码,特殊字符必须原样传入。
403+
return fmt.Sprintf("%s:%s", rawUser, rawPassword)
406404
}
407405

408406
// split comma separated list of key=value pairs and return a map of key value pairs

0 commit comments

Comments
 (0)