Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Return 400 from og-image-poll when title is missing (#3645)

Luke Vella1b7ad4884605
diff --git a/apps/web/src/app/api/og-image-poll/route.tsx b/apps/web/src/app/api/og-image-poll/route.tsx
index f0818c8ce..f0fbf4e35 100644
--- a/apps/web/src/app/api/og-image-poll/route.tsx
+++ b/apps/web/src/app/api/og-image-poll/route.tsx
@@ -22,11 +22,17 @@ const boldFont = fs.readFileSync(
export async function GET(req: NextRequest) {
const { searchParams } = new URL(req.url);
- const { title, author } = schema.parse({
+ const parsed = schema.safeParse({
title: searchParams.get("title"),
author: searchParams.get("author"),
});
+ if (!parsed.success) {
+ return new Response("Invalid parameters", { status: 400 });
+ }
+
+ const { title, author } = parsed.data;
+
return new ImageResponse(
<div tw="flex relative flex-col bg-gray-100 w-full h-full px-[80px] py-[70px] items-start justify-center">
<div tw="h-full flex flex-col w-full justify-start">