The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Fix the image upload
Kiran K7efa43f15915
diff --git a/apps/web/lib/zod/schemas/misc.ts b/apps/web/lib/zod/schemas/misc.tsindex d939784be1..6f84df6f5a 100644--- a/apps/web/lib/zod/schemas/misc.ts+++ b/apps/web/lib/zod/schemas/misc.ts@@ -63,6 +63,7 @@ export const maxDurationSchema = z.coerce// Base64 encoded imageexport const base64ImageSchema = z.string()+ .trim().regex(/^data:image\/(png|jpeg|jpg|gif|webp);base64,/, {message: "Invalid image format, supports only png, jpeg, jpg, gif, webp.",})@@ -98,6 +99,7 @@ export const uploadedImageSchema = zz.string().url()+ .trim().refine((url) => url.startsWith(R2_URL), {message: `URL must start with ${R2_URL}`,}),@@ -107,6 +109,7 @@ export const uploadedImageSchema = zexport const publicHostedImageSchema = z.string().url()+ .trim().refine((url) => url.startsWith("http://") || url.startsWith("https://"), {message: "Image URL must start with http:// or https://",});