fix(web): normalize server addresses before connecting

This commit is contained in:
2026-07-22 23:25:49 +08:00
parent f5e6db0c35
commit 5ee346e222
2 changed files with 7 additions and 2 deletions

View File

@@ -136,6 +136,7 @@ function fallbackErrorMessage(status: number) {
}
export function normalizeBaseUrl(value: string) {
const trimmed = value.trim()
return trimmed.replace(/\/+$/, '')
const normalized = value.trim().replace(/\/+$/, '')
if (!normalized || /^https?:\/\//i.test(normalized)) return normalized
return `http://${normalized}`
}