From 05bc759af6a457a04dbd04401fcc867d2c3efe12 Mon Sep 17 00:00:00 2001 From: James Coglan Date: Sun, 18 Dec 2011 16:09:36 +0000 Subject: [PATCH] Make protocol vaidation a little more strict. --- lib/faye/websocket/protocol8_parser/handshake.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; };