diff --git a/lib/transports/websocket/hybi-16.js b/lib/transports/websocket/hybi-16.js index d84e10cda0..69967dad28 100644 --- a/lib/transports/websocket/hybi-16.js +++ b/lib/transports/websocket/hybi-16.js @@ -1,4 +1,3 @@ - /*! * socket.io-node * Copyright(c) 2011 LearnBoost @@ -98,7 +97,7 @@ WebSocket.prototype.onSocketConnect = function () { return; } - var origin = this.req.headers['origin'] + var origin = this.req.headers['origin'] || '' , location = ((this.manager.settings['match origin protocol'] ? origin.match(/^https/) : this.socket.encrypted) ? 'wss' : 'ws')