# HG changeset patch # User Matthew Wild # Date 1602766882 -3600 # Node ID eae8046d51fc35ef57019c78380711e55bc39eb1 # Parent 4e5a2af9dd19d7d20380d1b16646c16a5c50e59b net.websocket.frames: Add test for empty frame with MASK and key set diff -r 4e5a2af9dd19 -r eae8046d51fc spec/net_websocket_frames_spec.lua --- a/spec/net_websocket_frames_spec.lua Wed Oct 14 19:41:42 2020 +0200 +++ b/spec/net_websocket_frames_spec.lua Thu Oct 15 14:01:22 2020 +0100 @@ -43,6 +43,15 @@ ["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 @@ 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);