Skip to content

Commit

Permalink
Merge pull request socketio#1031 from secobarbital/master
Browse files Browse the repository at this point in the history
Fixed global variable leak
  • Loading branch information
rauchg committed Sep 15, 2012
2 parents c3ba8a7 + f5c32c1 commit ec07fa8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/transports/websocket/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ WebSocket.prototype.protocolVersion = 'hixie-76';
*/

WebSocket.prototype.onSocketConnect = function () {
var self = this;
var self = this
, location;

this.socket.setNoDelay(true);

Expand All @@ -89,11 +90,11 @@ WebSocket.prototype.onSocketConnect = function () {

var origin = this.req.headers['origin']
, waitingForNonce = false;
if(this.manager.settings['match origin protocol']){
if (this.manager.settings['match origin protocol']) {
location = (origin.indexOf('https')>-1 ? 'wss' : 'ws') + '://' + this.req.headers.host + this.req.url;
}else if(this.socket.encrypted){
} else if (this.socket.encrypted){
location = 'wss://' + this.req.headers.host + this.req.url;
}else{
} else {
location = 'ws://' + this.req.headers.host + this.req.url;
}

Expand Down

0 comments on commit ec07fa8

Please sign in to comment.