diff --git a/app/api/route.ts b/app/api/route.ts index df5a079..373bf90 100644 --- a/app/api/route.ts +++ b/app/api/route.ts @@ -108,8 +108,8 @@ export async function POST(request: Request) { return new Response(voice.body, { headers: { - "X-Transcript": transcript, - "X-Response": response, + "X-Transcript": encodeURIComponent(transcript), + "X-Response": encodeURIComponent(response), }, }); } diff --git a/app/page.tsx b/app/page.tsx index d7a9672..0782c47 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -69,8 +69,12 @@ export default function Home() { body: formData, }); - const transcript = response.headers.get("X-Transcript"); - const text = response.headers.get("X-Response"); + const transcript = decodeURIComponent( + response.headers.get("X-Transcript") || "" + ); + const text = decodeURIComponent( + response.headers.get("X-Response") || "" + ); if (!response.ok || !transcript || !text || !response.body) { const error =