From f2a6d6b3c589cdd51fb0dfe855a5b3a19668b4ff Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 12 Sep 2020 22:12:23 -0700 Subject: [PATCH] Websocket cleanup --- router/websocket/message.go | 7 +------ router/websocket/websocket.go | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/router/websocket/message.go b/router/websocket/message.go index 3f998bc..8d5cebf 100644 --- a/router/websocket/message.go +++ b/router/websocket/message.go @@ -12,12 +12,7 @@ const ( ) type Message struct { - // The event to perform. Should be one of the following that are supported: - // - // - status : Returns the server's power state. - // - logs : Returns the server log data at the time of the request. - // - power : Performs a power action against the server based the data. - // - command : Performs a command on a server using the data field. + // The event to perform. Event string `json:"event"` // The data to pass along, only used by power/command currently. Other requests diff --git a/router/websocket/websocket.go b/router/websocket/websocket.go index 430c566..52160ae 100644 --- a/router/websocket/websocket.go +++ b/router/websocket/websocket.go @@ -95,8 +95,7 @@ func (h *Handler) SendJson(v *Message) error { // Do not send JSON down the line if the JWT on the connection is not // valid! if err := h.TokenValid(); err != nil { - h.server.Log().WithField("error", err).Warn("invalid JWT detected for server websocket!") - + h.SendErrorJson(*v, err) return nil }