Skip to content

Commit

Permalink
Fixed global leak
Browse files Browse the repository at this point in the history
  • Loading branch information
secobarbital committed Sep 15, 2012
1 parent c3ba8a7 commit f5c32c1
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 f5c32c1

Please sign in to comment.