Skip to content

Commit

Permalink
bugfix: fix(#85) (#88)
Browse files Browse the repository at this point in the history
Co-authored-by: charlesxie <charlesxie@tencent.com>
  • Loading branch information
cs-charles and charlesxie committed Jun 7, 2021
1 parent 631f725 commit 1c4a80f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/websocket/ws/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ func (u *Upgrader) Upgrade(c *connection.Connection, in *ringbuffer.RingBuffer)
err = onRequest(c, req.uri)
}
}
if err != nil {
return
}

// Start headers read/parse loop.
var (
// headerSeen reports which header was seen by setting corresponding
Expand All @@ -232,7 +236,7 @@ func (u *Upgrader) Upgrade(c *connection.Connection, in *ringbuffer.RingBuffer)
nonce = make([]byte, nonceSize)
)
for i := 1; i < len(lines); i++ {
if len(lines[i]) == 0 {
if err != nil || len(lines[i]) == 0 {
// Blank line, no more lines to read.
break
}
Expand Down

0 comments on commit 1c4a80f

Please sign in to comment.