make sure ports are numbers and domain names are lowercase

This commit is contained in:
tigerbot 2017-09-06 18:41:26 -06:00
parent 701aa99a30
commit d013de932f
1 changed files with 4 additions and 5 deletions

View File

@ -9,11 +9,11 @@ var stunneld = require('../wstunneld.js');
var greenlock = require('greenlock');
function collectServernames(val, memo) {
val.split(/,/).forEach(function (servername) {
memo.push(servername.toLowerCase());
var lowerCase = val.split(/,/).map(function (servername) {
return servername.toLowerCase();
});
return memo;
return memo.concat(lowerCase);
}
function collectProxies(val, memo) {
@ -65,8 +65,7 @@ function collectProxies(val, memo) {
}
function collectPorts(val, memo) {
memo = memo.concat(val.split(/,/g).filter(Boolean));
return memo;
return memo.concat(val.split(/,/g).map(Number).filter(Boolean));
}
program