Fixed missing isIPMatch(), #4172
Ylian Saint-Hilaire committed
Jun 28, 2022 at 23:53 UTC
3633c9ff81c69ddcc8790a95d86dbfc808a855ed
1 file changed
+7
webrelayserver.js
+7
@@ -257,6 +257,13 @@ module.exports.CreateWebRelayServer = function (parent, db, args, certificates,
257
258
function getRandomPassword() { return Buffer.from(require('crypto').randomBytes(9), 'binary').toString('base64').split('/').join('@'); }
259
260
+ // Perform a IP match against a list
261
+ function isIPMatch(ip, matchList) {
262
+ const ipcheck = require('ipcheck');
263
+ for (var i in matchList) { if (ipcheck.match(ip, matchList[i]) == true) return true; }
264
+ return false;
265
+ }
266
+
267
// Start up the web relay server
268
serverStart();
269
CheckListenPort(args.relayport, args.relayportbind, StartWebRelayServer);