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) {
return config.server.peersPath + '/' +
(
node.hostname + '@' +
node.mac + '@' +
(node.hostname || '') + '@' +
(node.mac || '') + '@' +
(node.key || '') + '@' +
token + '@' +
(token || '') + '@' +
(nodeSecrets.monitoringToken || '')
).toLowerCase();
}