Mercurial > prosody-hg
comparison plugins/mod_websocket.lua @ 10581:10d6d0d91f4e 0.11 0.11.4
mod_websocket: Clear mask bit when reflecting ping frames (fixes #1484)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 02 Jan 2020 10:49:37 +0100 |
| parents | 4b3c129e96f2 |
| children | 6d4562acef81 37936c72846d |
comparison
equal
deleted
inserted
replaced
| 10578:419ac5ef2d3d | 10581:10d6d0d91f4e |
|---|---|
| 234 elseif opcode == 0x8 then -- Close request | 234 elseif opcode == 0x8 then -- Close request |
| 235 websocket_close(1000, "Goodbye"); | 235 websocket_close(1000, "Goodbye"); |
| 236 return; | 236 return; |
| 237 elseif opcode == 0x9 then -- Ping frame | 237 elseif opcode == 0x9 then -- Ping frame |
| 238 frame.opcode = 0xA; | 238 frame.opcode = 0xA; |
| 239 frame.MASK = false; -- Clients send masked frames, servers don't, see #1484 | |
| 239 conn:write(build_frame(frame)); | 240 conn:write(build_frame(frame)); |
| 240 return ""; | 241 return ""; |
| 241 elseif opcode == 0xA then -- Pong frame, MAY be sent unsolicited, eg as keepalive | 242 elseif opcode == 0xA then -- Pong frame, MAY be sent unsolicited, eg as keepalive |
| 242 return ""; | 243 return ""; |
| 243 else | 244 else |
