From cc07e19f6bef632df427bdecf4539f32c73dea5f Mon Sep 17 00:00:00 2001 From: Ankit Dash Date: Tue, 2 Jul 2024 00:01:32 +0530 Subject: [PATCH] add image url instead of string --- apps/studio-next/src/app/api/crawler/route.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/studio-next/src/app/api/crawler/route.tsx b/apps/studio-next/src/app/api/crawler/route.tsx index f8c7f6dce..79b9550d3 100644 --- a/apps/studio-next/src/app/api/crawler/route.tsx +++ b/apps/studio-next/src/app/api/crawler/route.tsx @@ -9,10 +9,7 @@ export async function GET(request: NextRequest) { if (!searchParams) return new NextResponse(null, { status: 200 }); const info: DocumentInfo = await parseURL(searchParams); - const ogImageurl = `https://ogp-studio.vercel.app/api/og?title=${info.title}&description=${info.description}&numServers=${info.numServers}&numChannels=${info.numChannels}`; - const ogImage = await fetch(ogImageurl); - const ogImageBuffer = await ogImage.arrayBuffer(); - const ogImageBase64 = Buffer.from(ogImageBuffer).toString('base64'); + const ogImageurl = `https://ogp-studio.vercel.app/api/og?title=${encodeURIComponent(info.title!)}&description=${encodeURIComponent(info.description!)}&numServers=${info.numServers}&numChannels=${info.numChannels}`; const crawlerInfo = ` @@ -24,7 +21,7 @@ export async function GET(request: NextRequest) { ${info.title} ${info.title ? `` : ''} ${info.description ? `` : ''} - + `;