Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -10,10 +10,11 @@ export async function GET({ params }: { params: { name: string } }) {
|
||||
return json({ ok: false, reason: 'Server not found' }, { status: 404, headers });
|
||||
}
|
||||
const path = resolveLogPath(server.name, gameLogKey(server.name));
|
||||
if (!path) return json({ ok: false, reason: 'Path traversal rejected' }, { status: 400, headers });
|
||||
if (!path)
|
||||
return json({ ok: false, reason: 'Path traversal rejected' }, { status: 400, headers });
|
||||
|
||||
try {
|
||||
return json({ ok: true, ...await collectServerChat(server) }, { headers });
|
||||
return json({ ok: true, ...(await collectServerChat(server)) }, { headers });
|
||||
} catch (error) {
|
||||
console.error('Could not read server chat', error);
|
||||
return json({ ok: false, reason: 'Could not read server chat' }, { status: 500, headers });
|
||||
|
||||
Reference in New Issue
Block a user