Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use sha1 hash session ids

  • Loading branch information...
commit 66a0824653b47e078b0df01a7313f02e0092c0a0 1 parent c2155c6
@xantus authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/socket.io/client.js
View
6 lib/socket.io/client.js
@@ -1,4 +1,4 @@
-var options = require('./util/options').options, urlparse = require('url').parse;
+var options = require('./util/options').options, urlparse = require('url').parse, sha1 = require('./util/sha1').sha1;
exports.Client = Class({
@@ -116,7 +116,7 @@ exports.Client = Class({
if (this.sessionId) {
return this.listener.options.log('This client already has a session id');
}
- this.sessionId = Math.random().toString().substr(2);
+ this.sessionId = sha1(Math.random().toString().substr(2));
return this;
},
@@ -128,4 +128,4 @@ exports.Client = Class({
origins.indexOf('*:' + parts.port) !== -1;
}
-});
Please sign in to comment.
Something went wrong with that request. Please try again.