mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
net.websocket.frames: Add test for empty frame with MASK and key set
This commit is contained in:
parent
00bad1a9fe
commit
64856637ce
1 changed files with 10 additions and 0 deletions
|
@ -43,6 +43,15 @@ describe("net.websocket.frames", function ()
|
|||
["RSV2"] = false;
|
||||
["RSV3"] = false;
|
||||
};
|
||||
empty_with_mask = {
|
||||
["opcode"] = 0;
|
||||
["key"] = " \0 \0";
|
||||
["FIN"] = true;
|
||||
["MASK"] = true;
|
||||
["RSV1"] = false;
|
||||
["RSV2"] = false;
|
||||
["RSV3"] = false;
|
||||
};
|
||||
}
|
||||
|
||||
describe("build", function ()
|
||||
|
@ -52,6 +61,7 @@ describe("net.websocket.frames", function ()
|
|||
assert.equal("\0\5hello", build(test_frames.simple_data));
|
||||
assert.equal("\128\0", build(test_frames.simple_fin));
|
||||
assert.equal("\128\133 \0 \0HeLlO", build(test_frames.with_mask))
|
||||
assert.equal("\128\128 \0 \0", build(test_frames.empty_with_mask))
|
||||
end);
|
||||
end);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue