● Zion Boggan zionboggan.com ↗

Return clean 404 for malformed event/profile ids

b34fff2   Zion Boggan committed on Jun 25, 2026 (1 month ago)
apps/web/src/app/city/[slug]/event/[id]/page.tsx +3 -0
@@ -45,6 +45,9 @@ export default async function EventPage({
params: Promise<{ slug: string; id: string }>;
}) {
const { slug, id } = await params;
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id)) {
+ notFound();
+ }
const caller = serverCaller();
const city = await caller.city.bySlug({ slug });
if (!city) notFound();
apps/web/src/app/city/[slug]/profile/[kind]/[id]/page.tsx +3 -0
@@ -35,6 +35,9 @@ export default async function ProfilePage({
const label = KIND_LABEL[kind];
if (!label) notFound();
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id)) {
+ notFound();
+ }
let title = "";
let typeLine = label.toUpperCase();