Open okonos opened 2 years ago
Example connection string:
user=db_user dbname=mydb password=my*passw?o=rd host=localhost port=5432 sslmode=disable timezone=UTC
No error is produced, the password is silently leaked into the segments.
If you happen to have stumbled upon this issue looking for solution, this can be worked around using URI format and escaping the password with net/url.PathEscape:
net/url.PathEscape
url := "postgres://db_user:" + url.PathEscape("my*passw?o=rd") + "@localhost:5432/mydb?sslmode=disable&timezone=UTC"
Example connection string:
No error is produced, the password is silently leaked into the segments.
If you happen to have stumbled upon this issue looking for solution, this can be worked around using URI format and escaping the password with
net/url.PathEscape
: