mod_websocket: Clear mask bit when reflecting ping frames (fixes #1484) 0.11 0.11.4
authorKim Alvefur <zash@zash.se>
Thu, 02 Jan 2020 10:49:37 +0100
branch0.11
changeset 10585 10d6d0d91f4e
parent 10582 419ac5ef2d3d
child 10586 6d4562acef81
child 10600 cb107ea49b35
child 10610 aa8d133f2ee7
mod_websocket: Clear mask bit when reflecting ping frames (fixes #1484)
plugins/mod_websocket.lua
--- a/plugins/mod_websocket.lua	Tue Dec 31 02:50:25 2019 +0100
+++ b/plugins/mod_websocket.lua	Thu Jan 02 10:49:37 2020 +0100
@@ -236,6 +236,7 @@
 			return;
 		elseif opcode == 0x9 then -- Ping frame
 			frame.opcode = 0xA;
+			frame.MASK = false; -- Clients send masked frames, servers don't, see #1484
 			conn:write(build_frame(frame));
 			return "";
 		elseif opcode == 0xA then -- Pong frame, MAY be sent unsolicited, eg as keepalive