Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lxzan committed Jan 4, 2023
1 parent 9e6f2f7 commit 0f6b33b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func (c *Message) Bytes() []byte {
}

func payloadValid(opcode Opcode, buf *internal.Buffer) bool {
if buf.Len() == 0 && !(opcode == OpcodeCloseConnection || opcode == OpcodeText) {
return true
if buf.Len() > 0 && (opcode == OpcodeCloseConnection || opcode == OpcodeText) {
return utf8.Valid(buf.Bytes())
}
return utf8.Valid(buf.Bytes())
return true
}

func maskXOR(b []byte, key []byte) {
Expand Down

0 comments on commit 0f6b33b

Please sign in to comment.