agent: don't replace empty tokens in the logs, fixes #1020
This commit is contained in:
parent
d69e3ce19e
commit
47073c87c1
|
@ -293,6 +293,10 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque
|
||||||
logURL := req.URL.String()
|
logURL := req.URL.String()
|
||||||
if tokens, ok := formVals["token"]; ok {
|
if tokens, ok := formVals["token"]; ok {
|
||||||
for _, token := range tokens {
|
for _, token := range tokens {
|
||||||
|
if token == "" {
|
||||||
|
logURL += "<hidden>"
|
||||||
|
continue
|
||||||
|
}
|
||||||
logURL = strings.Replace(logURL, token, "<hidden>", -1)
|
logURL = strings.Replace(logURL, token, "<hidden>", -1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue