diff --git a/.gitignore b/.gitignore index fb102b19..3a442175 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ test_data # Go workspace file .idea .vscode + +# VSCode local history +.history diff --git a/src/lib/config/config.go b/src/lib/config/config.go index 06d853e9..c98b6546 100644 --- a/src/lib/config/config.go +++ b/src/lib/config/config.go @@ -1,6 +1,9 @@ package config -import "fmt" +import ( + "fmt" + "net/url" +) // this is a pointer so that if someone attempts to use it before loading it will // panic and force them to load it first. @@ -63,12 +66,12 @@ type postgresConfigCommon struct { func (c postgresConfigCommon) DSN() string { return fmt.Sprintf( "postgres://%s:%s@%s:%d/%s?sslmode=disable", - c.User, - c.Password, - c.Host, - c.Port, - c.Database, - ) + url.QueryEscape(c.User), + url.QueryEscape(c.Password), + c.Host, + c.Port, + url.QueryEscape(c.Database), + ) } type carbonConfig struct {