diff --git a/ws/message_test.go b/ws/message_test.go index 2ecc989..04254c4 100644 --- a/ws/message_test.go +++ b/ws/message_test.go @@ -139,6 +139,22 @@ func TestReadEOF(t *testing.T) { "complete extended 64 bits length", []byte{0x82,127, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, true, + }, { + "missing mask", + []byte{0x82,0x80}, + true, false, + }, { + "incomplete mask 1", + []byte{0x82,0x80, 0x00}, + true, false, + }, { + "incomplete mask 2", + []byte{0x82,0x80, 0x00, 0x00, 0x00}, + true, false, + },{ + "complete mask", + []byte{0x82,0x80, 0x00, 0x00, 0x00, 0x00}, + false, false, }, }