From 57c43c50a752154325d9cc8701778f44af30e187 Mon Sep 17 00:00:00 2001 From: wellenvogel Date: Mon, 3 Jan 2022 19:42:37 +0100 Subject: [PATCH] add check for TCP client ip address --- web/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/index.js b/web/index.js index 74dcc42..eafb494 100644 --- a/web/index.js +++ b/web/index.js @@ -162,6 +162,14 @@ function checkAdminPass(v){ return checkApPass(v); } +function checkIpAddress(v,allValues,def){ + if (allValues.tclEnabled != "true") return; + if (! v) return "cannot be empty"; + if (! v.match(/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/) + && ! v.match(/.*\.local/)) + return "must be either in the form 192.168.1.1 or xxx.local"; +} + function checkXDR(v,allValues){ if (! v) return; let parts=v.split(',');