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
commit12e7ec39fced7a5b6cdc9d40a97c3a91ced980eb (patch)
treeec5c1863719d548bd3dda13b515ff61376753308
parent517c36edcf6ee63e15a333af469da91e19c8995a (diff)
downloadprosody-12e7ec39fced7a5b6cdc9d40a97c3a91ced980eb.tar.gz
prosody-12e7ec39fced7a5b6cdc9d40a97c3a91ced980eb.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);