agent: don't replace empty tokens in the logs, fixes #1020

This commit is contained in:
Ryan Uber 2015-06-12 00:09:51 -07:00
parent d69e3ce19e
commit 47073c87c1
1 changed files with 4 additions and 0 deletions

View File

@ -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)
} }
} }