Skip to content

Commit

Permalink
fix parseInt/default expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed May 8, 2017
1 parent 919604c commit 3ffa301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sockets.js
Expand Up @@ -111,7 +111,7 @@ module.exports = function (server, config) {
config.turnservers.forEach(function (server) {
var hmac = crypto.createHmac('sha1', server.secret);
// default to 86400 seconds timeout unless specified
var username = Math.floor(new Date().getTime() / 1000) + (parseInt(server.expiry, 10) || 86400) + "";
var username = Math.floor(new Date().getTime() / 1000) + (parseInt(server.expiry || 86400, 10)) + "";
hmac.update(username);
credentials.push({
username: username,
Expand Down

0 comments on commit 3ffa301

Please sign in to comment.