diff --git a/pkg/wsapi/api.go b/pkg/wsapi/api.go index 9615258..2277257 100644 --- a/pkg/wsapi/api.go +++ b/pkg/wsapi/api.go @@ -195,14 +195,16 @@ func (ws *cmdHandler) handleMsg(r io.Reader) error { } nd := newData(cmd) - err = mapstructure.Decode(&msgMap, &nd) - if err != nil { - ws.writeError(id, Error{ - Code: "invalid_format", - Message: err.Error(), - }) + if _, ok := nd.(map[string]interface{}); !ok { + err := mapstructure.Decode(&msgMap, &nd) + if err != nil { + ws.writeError(id, Error{ + Code: "invalid_format", + Message: err.Error(), + }) - return nil + return nil + } } return hand(ws, id, cmd, nd)