escaping ssl mode on postgres param

This commit is contained in:
yogyrahmawan 2018-07-22 08:04:57 +07:00
parent bfd05ba6ec
commit 26aa575cb4

View File

@ -53,7 +53,11 @@ func generateConnectionString(datasource *models.DataSource) string {
}
sslmode := datasource.JsonData.Get("sslmode").MustString("verify-full")
u := &url.URL{Scheme: "postgres", User: url.UserPassword(datasource.User, password), Host: datasource.Url, Path: datasource.Database, RawQuery: "sslmode=" + sslmode}
u := &url.URL{Scheme: "postgres",
User: url.UserPassword(datasource.User, password),
Host: datasource.Url, Path: datasource.Database,
RawQuery: "sslmode=" + url.QueryEscape(sslmode)}
return u.String()
}