Commit 05da21c6 by Marcus Efraimsson Committed by GitHub

Merge pull request #12678 from yogyrahmawan/escape_postgres_parameters

postgres; escape ssl mode parameter
parents 4d722b21 93e73919
......@@ -53,7 +53,13 @@ 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()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment