Skip to content
Merged
Show file tree
Hide file tree
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/routes/clips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ clipsRouter.post('/batch/compress-published', asyncHandler(async (req, res) => {
await new CompressPublishedClipAction().execute({ clipId });
} catch (error) {
failed += 1;
// The id is from the request, so it is an argument, never part of the
// format string, where a `%s` would be read as a directive.
console.error(
`[batch] compressing the published copy of clip ${clipId} failed:`,
'[batch] compressing the published copy of clip %s failed: %s',
String(clipId),
error instanceof Error ? error.message : String(error),
);
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/services/streamdeck/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export async function startStreamDeck(): Promise<void> {
};

const path = (req.url ?? '').split('?')[0];
const route = ROUTES[`${req.method} ${path}`];
// An own property only: the key comes from the request, and a bare lookup
// would also find what every object inherits.
const key = `${req.method} ${path}`;
const route = Object.hasOwn(ROUTES, key) ? ROUTES[key] : undefined;
if (!route) return send(404, { error: 'No such key' });

void readBody(req)
Expand Down
Loading