diff --git a/lib/faye/websocket/protocol8_parser/handshake.js b/lib/faye/websocket/protocol8_parser/handshake.js index a531311..24a4bc5 100644 --- a/lib/faye/websocket/protocol8_parser/handshake.js +++ b/lib/faye/websocket/protocol8_parser/handshake.js @@ -84,7 +84,7 @@ Handshake.prototype.isValid = function() { return upgrade && /^websocket$/i.test(upgrade) && connection && connection.split(/\s*,\s*/).indexOf('Upgrade') >= 0 && - (!this._protocols || this.protocol) && + ((!this._protocols && !protocol) || this.protocol) && this._headers['Sec-WebSocket-Accept'] === this._accept; };