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 | 9a25dc6d776fb7e01d53036d353fa12c874a64c4 (patch) | |
tree | ec5c1863719d548bd3dda13b515ff61376753308 /spec | |
parent | ca36c38a51401217183c8be4735b5566d14f3826 (diff) | |
download | prosody-9a25dc6d776fb7e01d53036d353fa12c874a64c4.tar.gz prosody-9a25dc6d776fb7e01d53036d353fa12c874a64c4.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); |