Only send hello message to non-JSON clients
This commit is contained in:
parent
e62a9053a3
commit
764def5eea
2 changed files with 4 additions and 1 deletions
|
@ -100,7 +100,7 @@ func (c *webSocketClient) writeEvents(closeWrite chan struct{}) {
|
|||
|
||||
setTimeout()
|
||||
var event []byte
|
||||
for event = range c.events {
|
||||
for {
|
||||
select {
|
||||
case <-closeWrite:
|
||||
for {
|
||||
|
|
|
@ -272,6 +272,9 @@ func (s *server) randomUsername() []byte {
|
|||
}
|
||||
|
||||
func (s *server) sendHello(c *serverClient) {
|
||||
if c.json {
|
||||
return
|
||||
}
|
||||
c.Write(s.welcome)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue