diff --git a/command/agent/agent_endpoint_test.go b/command/agent/agent_endpoint_test.go index 522a508d13..d9db96210e 100644 --- a/command/agent/agent_endpoint_test.go +++ b/command/agent/agent_endpoint_test.go @@ -1,6 +1,7 @@ package agent import ( + "bytes" "errors" "fmt" "io" @@ -117,6 +118,15 @@ func TestHTTPAgentSelf(t *testing.T) { if val.Coord != nil { t.Fatalf("should have been nil: %v", val.Coord) } + + // Make sure there's nothing called "token" that's leaked. + raw, err := srv.marshalJSON(req, obj) + if err != nil { + t.Fatalf("err: %v", err) + } + if bytes.Contains(bytes.ToLower(raw), []byte("token")) { + t.Fatalf("bad: %s", raw) + } } func TestHTTPAgentReload(t *testing.T) {