Skip to content

Commit

Permalink
Fixes when browser doesn't send origin header, defaults to empty stri…
Browse files Browse the repository at this point in the history
…ng instead of UNDEFINED (which would throw an error on the origin.match(/^https/) below
  • Loading branch information
crickeys committed Apr 11, 2012
1 parent a4e53a6 commit 1a5a87a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/transports/websocket/hybi-16.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <[email protected]>
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 1a5a87a

Please sign in to comment.