Skip to content

Commit

Permalink
bugfix: fix(#85) (#86)
Browse files Browse the repository at this point in the history
* bugfix: fix(#85)

Co-authored-by: charlesxie <[email protected]>
  • Loading branch information
cs-charles and charlesxie authored Jun 7, 2021
1 parent 7f3b776 commit 4f22261
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 @@ -223,6 +223,10 @@ func (u *Upgrader) Upgrade(in *ringbuffer.RingBuffer) (out []byte, hs Handshake,
err = onRequest(req.uri)
}
}
if err != nil {
return
}

// Start headers read/parse loop.
var (
// headerSeen reports which header was seen by setting corresponding
Expand All @@ -231,7 +235,7 @@ func (u *Upgrader) Upgrade(in *ringbuffer.RingBuffer) (out []byte, hs Handshake,
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 4f22261

Please sign in to comment.