File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11import type { APIRoute } from "astro" ;
22import { generateOgImageForSite } from "@/utils/generateOgImages" ;
33
4- export const GET : APIRoute = async ( ) =>
5- new Response ( await generateOgImageForSite ( ) , {
4+ export const GET : APIRoute = async ( ) => {
5+ const buffer = await generateOgImageForSite ( ) ;
6+ return new Response ( new Uint8Array ( buffer ) , {
67 headers : { "Content-Type" : "image/png" } ,
78 } ) ;
9+ } ;
Original file line number Diff line number Diff line change @@ -27,10 +27,8 @@ export const GET: APIRoute = async ({ props }) => {
2727 } ) ;
2828 }
2929
30- return new Response (
31- await generateOgImageForPost ( props as CollectionEntry < "blog" > ) ,
32- {
33- headers : { "Content-Type" : "image/png" } ,
34- }
35- ) ;
30+ const buffer = await generateOgImageForPost ( props as CollectionEntry < "blog" > ) ;
31+ return new Response ( new Uint8Array ( buffer ) , {
32+ headers : { "Content-Type" : "image/png" } ,
33+ } ) ;
3634} ;
You can’t perform that action at this time.
0 commit comments