Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/services/streamdeck/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export async function startStreamDeck(): Promise<void> {

const path = (req.url ?? '').split('?')[0];
const route = ROUTES.get(`${req.method} ${path}`);
if (!route) return send(404, { error: 'No such key' });
// Only ever something this file put there, and checked to be callable
// before it is called, which is the guard code scanning asks for when a
// request chooses what runs.
if (typeof route !== 'function') return send(404, { error: 'No such key' });

void readBody(req)
.then((body) => route(body))
Expand Down
Loading