mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
ugh
This commit is contained in:
@@ -46,8 +46,8 @@ function extractStreamInfo(path) {
|
|||||||
const remaining = segments.slice(start, end);
|
const remaining = segments.slice(start, end);
|
||||||
if (remaining.length === 1) {
|
if (remaining.length === 1) {
|
||||||
const rawId = remaining[0] || '';
|
const rawId = remaining[0] || '';
|
||||||
const id = rawId.endsWith('-audio') ? rawId.slice(0, -6) : rawId;
|
const baseId = rawId.endsWith('-audio') ? rawId.slice(0, -6) : rawId;
|
||||||
return { type: 'rover', id };
|
return { type: 'rover', id: rawId, baseId };
|
||||||
}
|
}
|
||||||
if (remaining.length === 2 && remaining[0] === 'room') {
|
if (remaining.length === 2 && remaining[0] === 'room') {
|
||||||
return { type: 'room', id: remaining[1] || '' };
|
return { type: 'room', id: remaining[1] || '' };
|
||||||
@@ -98,7 +98,8 @@ app.post('/mediamtx/auth', (req, res) => {
|
|||||||
}
|
}
|
||||||
const role = getRole(socket);
|
const role = getRole(socket);
|
||||||
if (streamInfo.type === 'rover' && role !== 'spectator' && !isAdmin(socket)) {
|
if (streamInfo.type === 'rover' && role !== 'spectator' && !isAdmin(socket)) {
|
||||||
if (!roverManager.isDriver(streamInfo.id, socket)) {
|
const roverId = streamInfo.baseId || streamInfo.id;
|
||||||
|
if (!roverManager.isDriver(roverId, socket)) {
|
||||||
return res.status(401).end();
|
return res.status(401).end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user