Skip to content

Commit 1c4a80f

Browse files
cs-charlescharlesxie
and
charlesxie
authored
bugfix: fix(#85) (#88)
Co-authored-by: charlesxie <[email protected]>
1 parent 631f725 commit 1c4a80f

File tree

1 file changed

+5
-1
lines changed
  • plugins/websocket/ws

1 file changed

+5
-1
lines changed

plugins/websocket/ws/ws.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ func (u *Upgrader) Upgrade(c *connection.Connection, in *ringbuffer.RingBuffer)
224224
err = onRequest(c, req.uri)
225225
}
226226
}
227+
if err != nil {
228+
return
229+
}
230+
227231
// Start headers read/parse loop.
228232
var (
229233
// headerSeen reports which header was seen by setting corresponding
@@ -232,7 +236,7 @@ func (u *Upgrader) Upgrade(c *connection.Connection, in *ringbuffer.RingBuffer)
232236
nonce = make([]byte, nonceSize)
233237
)
234238
for i := 1; i < len(lines); i++ {
235-
if len(lines[i]) == 0 {
239+
if err != nil || len(lines[i]) == 0 {
236240
// Blank line, no more lines to read.
237241
break
238242
}

0 commit comments

Comments
 (0)