mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 18:42:27 +08:00
escaping ssl mode on postgres param
This commit is contained in:
@ -53,7 +53,11 @@ func generateConnectionString(datasource *models.DataSource) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sslmode := datasource.JsonData.Get("sslmode").MustString("verify-full")
|
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()
|
return u.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user