From 1b4167699fb7bbdacaaa05371ab46fa109a22101 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Fri, 12 Jun 2015 00:09:51 -0700 Subject: [PATCH] agent: don't replace empty tokens in the logs, fixes #1020 --- command/agent/http.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/agent/http.go b/command/agent/http.go index c5a5421fc1..8e5ea7c24e 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -293,6 +293,10 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque logURL := req.URL.String() if tokens, ok := formVals["token"]; ok { for _, token := range tokens { + if token == "" { + logURL += "" + continue + } logURL = strings.Replace(logURL, token, "", -1) } }