mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
fix: validate probe target port input
This commit is contained in:
@@ -68,9 +68,11 @@ export const validateTunnelForm = (
|
||||
}
|
||||
|
||||
const probeHost = (form.probeTargetHost || "").trim();
|
||||
const probePort = Number(form.probeTargetPort || 0);
|
||||
const probePortInput = form.probeTargetPort;
|
||||
const probePort = Number(probePortInput ?? 0);
|
||||
const hasProbePort = probePortInput != null && probePortInput !== 0;
|
||||
|
||||
if (probeHost || probePort > 0) {
|
||||
if (probeHost || hasProbePort) {
|
||||
if (!probeHost) {
|
||||
errors.probeTargetHost = "请输入测试目标 Host";
|
||||
} else if (probeHost.includes("://") || /[\s/?#]/.test(probeHost)) {
|
||||
|
||||
Reference in New Issue
Block a user