From 79093c5057fbc172e86d17646a603619de933170 Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:56:43 +0200 Subject: [PATCH] fix(mediamtx): schema wasnt right --- .../src/app/(ui)/(protected)/api/mediamtx/publish/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(ui)/(protected)/api/mediamtx/publish/route.ts b/apps/web/src/app/(ui)/(protected)/api/mediamtx/publish/route.ts index 78202ce..9965ca4 100644 --- a/apps/web/src/app/(ui)/(protected)/api/mediamtx/publish/route.ts +++ b/apps/web/src/app/(ui)/(protected)/api/mediamtx/publish/route.ts @@ -26,7 +26,7 @@ export async function POST(request: NextRequest) { } const { action: parsedAction, protocol: parsedProtocol, path, password, token } = parsed.data; action = parsedAction; - protocol = parsedProtocol ?? 'none'; + protocol = parsedProtocol || 'none'; if (parsedAction === 'publish' && (parsedProtocol === 'srt' || parsedProtocol === 'webrtc')) { const channelKey = await redis.get(`streamKey:${path}`); @@ -98,7 +98,7 @@ const schema = z.object({ ip: z.string().default(''), action: z.enum(['publish', 'read', 'playback', 'api', 'metrics', 'pprof']), path: z.string().default(''), - protocol: z.enum(['rtsp', 'rtmp', 'hls', 'webrtc', 'srt']).optional(), + protocol: z.union([z.enum(['rtsp', 'rtmp', 'hls', 'webrtc', 'srt']), z.literal('')]).optional(), id: z.string().nullable().default(null), query: z.string().default(''), });