9 // - data (string)
10 // - type (string)
11 // - image (data url string)
12
13 // sanity checks:
15 // - data, hmm this needs to be long i guess.. maybe some crazy upper limit sanity check though
16 // - type, not too long
17 // - image, not toooo large a file size
18 let body;
19 try {
26 const data = body.data;
27 const type = body.type;
28 const image = body.image;
29
30 // Sanity checks
38 }
39
40 if (image.length > 20 * 1024 * 1024) {
41 return Response.json({ ok: false, error: "Thumbnail too large" });
42 }
58 );
59
60 await blob.set("pondiverse_image" + id.lastInsertRowid, image);
61 return Response.json({ ok: true });
62}