You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-07-31 20:44:25 +03:00
Add some more escapes to the query sanitizer
Signed-off-by: Tom Hughes <tom@compton.nu>
This commit is contained in:
@ -50,7 +50,12 @@ func sanitizeQuery(q string) string {
|
||||
q = strings.Join(strings.Fields(q), " ")
|
||||
q = strings.Replace(q, "(", "\\(", -1)
|
||||
q = strings.Replace(q, ")", "\\)", -1)
|
||||
q = strings.Replace(q, "[", "\\[", -1)
|
||||
q = strings.Replace(q, "]", "\\]", -1)
|
||||
q = strings.Replace(q, "{", "\\{", -1)
|
||||
q = strings.Replace(q, "}", "\\}", -1)
|
||||
q = strings.Replace(q, "*", "\\*", -1)
|
||||
q = strings.Replace(q, "^", "\\^", -1)
|
||||
q = strings.Replace(q, "$", "\\$", -1)
|
||||
return q
|
||||
}
|
||||
|
Reference in New Issue
Block a user