diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-10-15 14:01:22 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-10-15 14:01:22 +0100 |
commit | 64856637cee81b916cc240c55657eb13c0763620 (patch) | |
tree | ec5c1863719d548bd3dda13b515ff61376753308 /spec | |
parent | 00bad1a9fe73d56a6e48878a48505f2b6f4b8de3 (diff) | |
download | prosody-64856637cee81b916cc240c55657eb13c0763620.tar.gz prosody-64856637cee81b916cc240c55657eb13c0763620.zip |
net.websocket.frames: Add test for empty frame with MASK and key set
Diffstat (limited to 'spec')
-rw-r--r-- | spec/net_websocket_frames_spec.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/net_websocket_frames_spec.lua b/spec/net_websocket_frames_spec.lua index 244afa3b..519be7b9 100644 --- a/spec/net_websocket_frames_spec.lua +++ b/spec/net_websocket_frames_spec.lua @@ -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); |