Skip to content

Commit 0eba10f

Browse files
committed
CLI must escape urls too
1 parent 5ccbfd2 commit 0eba10f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/dbos/postgres.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"database/sql"
66
"fmt"
77
"io"
8+
"net/url"
89
"os"
910
"time"
1011

@@ -174,7 +175,7 @@ func startDockerPostgres() error {
174175
return err
175176
}
176177

177-
logger.Info("Postgres available", "url", fmt.Sprintf("postgres://postgres:%s@localhost:5432", password))
178+
logger.Info("Postgres available", "url", fmt.Sprintf("postgres://postgres:%s@localhost:5432", url.QueryEscape(password)))
178179
return nil
179180
}
180181

@@ -225,7 +226,7 @@ func waitForPostgres() error {
225226
password = "dbos"
226227
}
227228

228-
connStr := fmt.Sprintf("postgres://postgres:%s@localhost:5432/postgres?connect_timeout=2&sslmode=disable", password)
229+
connStr := fmt.Sprintf("postgres://postgres:%s@localhost:5432/postgres?connect_timeout=2&sslmode=disable", url.QueryEscape(password))
229230

230231
// Try for up to 30 seconds
231232
for i := 0; i < 30; i++ {

0 commit comments

Comments
 (0)