fix(web): normalize server addresses before connecting
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user