This commit is contained in:
OrbisAI Security 2026-05-25 01:55:06 +09:00 committed by GitHub
commit 3a6a7446ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,12 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ error: "Too many requests" }, { status: 429 });
}
const body = await request.json();
let body: unknown;
try {
body = await request.json();
} catch {
return NextResponse.json({ error: "Invalid JSON" }, { status: 400 });
}
const result = submitSchema.safeParse(body);
if (!result.success) {