mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 02:06: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 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) {
|
if (!probeHost) {
|
||||||
errors.probeTargetHost = "请输入测试目标 Host";
|
errors.probeTargetHost = "请输入测试目标 Host";
|
||||||
} else if (probeHost.includes("://") || /[\s/?#]/.test(probeHost)) {
|
} else if (probeHost.includes("://") || /[\s/?#]/.test(probeHost)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user