Support servers with subdirectory

This commit is contained in:
mikiher 2024-12-23 20:26:23 +02:00
parent 2452f09714
commit 16de3fdb97
4 changed files with 22 additions and 12 deletions

View file

@ -486,9 +486,8 @@ export default {
validateServerUrl(url, protocolOverride = null) {
try {
var urlObject = new URL(url)
var address = `${protocolOverride ? protocolOverride : urlObject.protocol}//${urlObject.hostname}`
if (urlObject.port) address += ':' + urlObject.port
return address
if (protocolOverride) urlObject.protocol = protocolOverride
return urlObject.href
} catch (error) {
console.error('Invalid URL', error)
return null