mirror of
https://github.com/gofiber/storage.git
synced 2025-10-04 08:16:36 +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:
|
env:
|
||||||
POSTGRES_DB: fiber
|
POSTGRES_DB: fiber
|
||||||
POSTGRES_USER: username
|
POSTGRES_USER: username
|
||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: "pass#w%rd"
|
||||||
options: >-
|
options: >-
|
||||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
@@ -57,4 +57,4 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
POSTGRES_DATABASE: fiber
|
POSTGRES_DATABASE: fiber
|
||||||
POSTGRES_USERNAME: username
|
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)
|
dsn += url.QueryEscape(cfg.Username)
|
||||||
}
|
}
|
||||||
if cfg.Password != "" {
|
if cfg.Password != "" {
|
||||||
dsn += ":" + cfg.Password
|
dsn += ":" + url.QueryEscape(cfg.Password)
|
||||||
}
|
}
|
||||||
if cfg.Username != "" || cfg.Password != "" {
|
if cfg.Username != "" || cfg.Password != "" {
|
||||||
dsn += "@"
|
dsn += "@"
|
||||||
|
Reference in New Issue
Block a user