mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
Url Escape the password provided to postgres
This commit is contained in:
4
.github/workflows/test-postgres.yml
vendored
4
.github/workflows/test-postgres.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
env:
|
||||
POSTGRES_DB: fiber
|
||||
POSTGRES_USER: username
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_PASSWORD: "pass#w%rd"
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
||||
--health-retries 5
|
||||
@@ -57,4 +57,4 @@ jobs:
|
||||
env:
|
||||
POSTGRES_DATABASE: fiber
|
||||
POSTGRES_USERNAME: username
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_PASSWORD: "pass#w%rd"
|
||||
|
@@ -55,7 +55,7 @@ func New(config ...Config) *Storage {
|
||||
dsn += url.QueryEscape(cfg.Username)
|
||||
}
|
||||
if cfg.Password != "" {
|
||||
dsn += ":" + cfg.Password
|
||||
dsn += ":" + url.QueryEscape(cfg.Password)
|
||||
}
|
||||
if cfg.Username != "" || cfg.Password != "" {
|
||||
dsn += "@"
|
||||
|
Reference in New Issue
Block a user