a tool for shared writing and social publishing

return fallback icon and fix cache-control directive

+3 -2
+3 -2
app/lish/[did]/[publication]/icon.ts
··· 4 4 import { PubLeafletPublication } from "lexicons/api"; 5 5 import { supabaseServerClient } from "supabase/serverClient"; 6 6 import sharp from "sharp"; 7 + import { redirect } from "next/navigation"; 7 8 8 9 let idResolver = new IdResolver(); 9 10 ··· 40 41 .single(); 41 42 42 43 let record = publication?.record as PubLeafletPublication.Record | null; 43 - if (!record?.icon) return null; 44 + if (!record?.icon) return redirect("/icon.png"); 44 45 45 46 let identity = await idResolver.did.resolve(did); 46 47 let service = identity?.service?.find((f) => f.id === "#atproto_pds"); ··· 58 59 return new Response(new Uint8Array(resizedImage), { 59 60 headers: { 60 61 "Content-Type": "image/png", 61 - "CDN-Cache-Control": "s-max-age=86400, stale-while-revalidate=86400", 62 + "CDN-Cache-Control": "s-maxage=86400, stale-while-revalidate=86400", 62 63 "Cache-Control": "public, max-age=3600", 63 64 }, 64 65 });