Don't parse incoming data if the client is already closed. This stops the headers being interpreted as WebSocket data if the client is closed before receiving the server's handshake. Fixes https://github.com/faye/websocket-extensions-node/issues/1.

This commit is contained in:
James Coglan
2015-02-21 12:34:37 +00:00
parent 0b7eedc3b5
commit 23d0a9ea5e
+1
View File
@@ -53,6 +53,7 @@ var instance = {
},
parse: function(data) {
if (this.readyState === 3) return;
if (this.readyState > 0) return Hybi.prototype.parse.call(this, data);
this._http.parse(data);