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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user