fix: V-002 security vulnerability
Automated security fix generated by Orbis Security AI
This commit is contained in:
parent
d1f4cb615b
commit
b059abf46d
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue