aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-10-15 14:01:22 +0100
committerMatthew Wild <mwild1@gmail.com>2020-10-15 14:01:22 +0100
commitaaf61ce16d87e65780fc15ce8a551e42989e6752 (patch)
treeec5c1863719d548bd3dda13b515ff61376753308
parent2fa0aa06d5d8b4f28e038e9bf8179f61ce3c6ba5 (diff)
downloadprosody-aaf61ce16d87e65780fc15ce8a551e42989e6752.tar.gz
prosody-aaf61ce16d87e65780fc15ce8a551e42989e6752.zip
net.websocket.frames: Add test for empty frame with MASK and key set
-rw-r--r--spec/net_websocket_frames_spec.lua10
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);