gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 489 forks source link

Must close connection on masked server->client frame #103

Closed gimite closed 12 years ago

gimite commented 12 years ago

http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#section-5.1

A client MUST close a connection if it detects a masked frame.

Related: #102

ranc commented 12 years ago

In WebSocket.as line 491, add: if (buffer[1]>127) { dispatchCloseEvent(false, 1002, "Server must not mask."); return null; }

gimite commented 12 years ago

Thanks. Pulled at https://github.com/gimite/web-socket-js/commit/14023075bfa7350a3a2268cb6d7e38e046b24bcf