This commit is contained in:
JonatanRek committed 2020-08-13 10:31:15 +02:00
1 parent 1ba0d7f9ba
commit 8d7722be91
3362 files changed
+13786 -500745

No files matched your search

+9 -2
View File
@@ -1,7 +1,7 @@
'use strict';
// Protocol references:
//
//
// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
// * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
@@ -32,7 +32,14 @@ var Driver = {
},
isWebSocket: function(request) {
return Base.isWebSocket(request);
if (request.method !== 'GET') return false;
var connection = request.headers.connection || '',
upgrade = request.headers.upgrade || '';
return request.method === 'GET' &&
connection.toLowerCase().split(/ *, */).indexOf('upgrade') >= 0 &&
upgrade.toLowerCase() === 'websocket';
},
validateOptions: function(options, validKeys) {