2
0
mirror of https://git.coolaj86.com/coolaj86/telebit-relay.js.git synced 2025-04-21 11:00:37 +00:00

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

View File

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