mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
gh
This commit is contained in:
@@ -71,15 +71,20 @@ function canView(socket) {
|
|||||||
app.post('/mediamtx/auth', (req, res) => {
|
app.post('/mediamtx/auth', (req, res) => {
|
||||||
const body = req.body || {};
|
const body = req.body || {};
|
||||||
const path = (body.path || '').replace(/^\//, '');
|
const path = (body.path || '').replace(/^\//, '');
|
||||||
|
const password = body.pass || body.password || '';
|
||||||
|
const action = body.action || '';
|
||||||
const sessionId = body.user;
|
const sessionId = body.user;
|
||||||
const streamInfo = extractStreamInfo(path);
|
const streamInfo = extractStreamInfo(path);
|
||||||
|
|
||||||
// Allow internal bridge (server-side audio transcode) to pull/push without a websocket session.
|
// Allow internal bridge (server-side audio transcode) to pull/push without a websocket session.
|
||||||
if (body.user === 'bridge' && body.pass === 'bridge') {
|
if (body.user === 'bridge' && password === 'bridge') {
|
||||||
return res.status(200).end();
|
return res.status(200).end();
|
||||||
}
|
}
|
||||||
// Also allow localhost reads of *-raw paths for the bridge even if creds are missing.
|
// Also allow localhost reads of *-raw paths for the bridge even if creds are missing.
|
||||||
if (!body.user && streamInfo?.id?.endsWith('-raw') && (req.ip === '127.0.0.1' || req.ip === '::1')) {
|
if (
|
||||||
|
streamInfo?.id?.endsWith('-raw') &&
|
||||||
|
(req.ip === '127.0.0.1' || req.ip === '::1')
|
||||||
|
) {
|
||||||
return res.status(200).end();
|
return res.status(200).end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user