From 8246cb8220adc8cfd360a86c6bc4896bc98e01a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Quiroz?= Date: Mon, 7 Feb 2022 23:01:49 -0300 Subject: [PATCH] chore: use .docx format for document download --- src/pages/api/download-application.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/api/download-application.ts b/src/pages/api/download-application.ts index 581c2859..1a73d389 100644 --- a/src/pages/api/download-application.ts +++ b/src/pages/api/download-application.ts @@ -4,7 +4,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const response = await fetch(process.env.PROJECT_GRANTS_DOWNLOAD_FILE_URL!); if (!response.ok) throw new Error(`unexpected response ${response.statusText}`); - res.setHeader('Content-Type', 'application/msword'); - res.setHeader('Content-Disposition', 'attachment; filename=projectGrantsApplication.doc'); + res.setHeader( + 'Content-Type', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' + ); + res.setHeader('Content-Disposition', 'attachment; filename=projectGrantsApplication.docx'); res.send(response.body); }