mirror of https://github.com/status-im/consul.git
agent: don't replace empty tokens in the logs, fixes #1020
This commit is contained in:
parent
d5dbcd78ca
commit
1b4167699f
|
@ -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