mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
AAAHGHG
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user