Websocket cleanup
This commit is contained in:
parent
0295603943
commit
f2a6d6b3c5
|
@ -12,12 +12,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
// The event to perform. Should be one of the following that are supported:
|
// The event to perform.
|
||||||
//
|
|
||||||
// - 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.
|
|
||||||
Event string `json:"event"`
|
Event string `json:"event"`
|
||||||
|
|
||||||
// The data to pass along, only used by power/command currently. Other requests
|
// The data to pass along, only used by power/command currently. Other requests
|
||||||
|
|
|
@ -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
|
// Do not send JSON down the line if the JWT on the connection is not
|
||||||
// valid!
|
// valid!
|
||||||
if err := h.TokenValid(); err != nil {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user