export const GET = async ({ url }) => { const response = await fetch(url.searchParams.get('url') as string); const contentType = response.headers.get('content-type') as string; if (contentType.includes('application/json')) { return Response.json(await response.json(), { headers: { 'Content-Type': 'application/json' } }); } else if (contentType.includes('text/html') || contentType.includes('text/plain')) { return new Response(await response.text(), { headers: { 'Content-Type': contentType } }); } else { return new Response(await response.blob(), { headers: { 'Content-Type': contentType } }); } };