This commit is contained in:
legop3
2025-11-14 22:47:04 -05:00
parent d524c312cf
commit 577a277e7c
+8 -1
View File
@@ -14,7 +14,14 @@ function buildWhepUrl(roverId) {
if (!base) {
return '';
}
const cleanBase = base.replace(/\/$/, '');
let origin;
try {
const parsed = new URL(base);
origin = parsed.origin;
} catch (err) {
origin = base.replace(/\/.*$/, '');
}
const cleanBase = origin.replace(/\/$/, '');
const encodedId = encodeURIComponent(roverId);
return `${cleanBase}/${encodedId}/whep`;
}