mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-05-04 08:58:03 +00:00
Merge 04e73d413c
into 6526065fbc
This commit is contained in:
commit
2fd6762d7f
@ -216,5 +216,14 @@ func loggableDSN(dsn string) string {
|
||||
pDSN.User = url.UserPassword(pDSN.User.Username(), "PASSWORD_REMOVED")
|
||||
}
|
||||
|
||||
// Blank password data from parameters if not nil
|
||||
q := pDSN.Query()
|
||||
if q != nil {
|
||||
if q.Get("password") != "" {
|
||||
q.Set("password", "PASSWORD_REMOVED")
|
||||
pDSN.RawQuery = q.Encode()
|
||||
}
|
||||
}
|
||||
|
||||
return pDSN.String()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user