More robust node filename generation.

Do not place "undefined" in parts of filenames even
if node files are missing entries like the token.
This commit is contained in:
baldo 2016-06-21 23:47:24 +02:00
parent 6c35daec45
commit b4dc9e37b2

View file

@ -121,10 +121,10 @@ angular.module('ffffng')
function toNodeFilename(token, node, nodeSecrets) { function toNodeFilename(token, node, nodeSecrets) {
return config.server.peersPath + '/' + return config.server.peersPath + '/' +
( (
node.hostname + '@' + (node.hostname || '') + '@' +
node.mac + '@' + (node.mac || '') + '@' +
(node.key || '') + '@' + (node.key || '') + '@' +
token + '@' + (token || '') + '@' +
(nodeSecrets.monitoringToken || '') (nodeSecrets.monitoringToken || '')
).toLowerCase(); ).toLowerCase();
} }