From b2aa3892c3624abaef1e4c9301ee0c94be4b926f Mon Sep 17 00:00:00 2001 From: Phil Constantinou Date: Sun, 21 Jan 2024 01:06:51 -0800 Subject: [PATCH] URL encode password --- backends/postgres/postgres_backend.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/postgres/postgres_backend.go b/backends/postgres/postgres_backend.go index 3d98dbb..0331b2d 100644 --- a/backends/postgres/postgres_backend.go +++ b/backends/postgres/postgres_backend.go @@ -5,6 +5,7 @@ import ( "embed" "errors" "fmt" + "net/url" "os" "sync" "time" @@ -344,7 +345,7 @@ func (p *PgBackend) initializeDB() (err error) { pqConnectionString := fmt.Sprintf("postgres://%s:%s@%s/%s?sslmode=%s&x-migrations-table=neoq_schema_migrations", pgxCfg.User, - pgxCfg.Password, + url.QueryEscape(pgxCfg.Password), pgxCfg.Host, pgxCfg.Database, sslMode)