Skip to content

Commit

Permalink
Fix: parse message type
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jun 5, 2019
1 parent f420fbe commit f8cd526
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion websocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"log"
"strings"
"sync"
"time"
"unicode"
Expand Down Expand Up @@ -377,7 +378,8 @@ func (c *Client) handleChannel(msg []byte) error {
return err
}

factory, ok := c.factories[data.ChannelName]
channel := strings.Split(data.ChannelName, "-")[0]
factory, ok := c.factories[channel]
if !ok {
return fmt.Errorf("Unknown message type: %s", data.ChannelName)
}
Expand Down

0 comments on commit f8cd526

Please sign in to comment.