Skip to content

Commit

Permalink
small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Apr 10, 2024
1 parent fc13907 commit 52df42c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/web/websocket/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ class ByteParser extends Writable {
// defined as the status code (Section 7.4) contained in the first Close
// control frame received by the application
code = data.readUInt16BE(0)
} else {
return null
}

if (code !== undefined && !isValidStatusCode(code)) {
if (!isValidStatusCode(code)) {
return null
}

Expand Down

0 comments on commit 52df42c

Please sign in to comment.