From da0ee84974d917c79aaa345d91f45da39a578a15 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 16 Sep 2020 23:38:19 +0200 Subject: [PATCH] fix content type for ical --- pages/api/daysbooked.ical.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/api/daysbooked.ical.tsx b/pages/api/daysbooked.ical.tsx index 4b89ea3..9e66366 100644 --- a/pages/api/daysbooked.ical.tsx +++ b/pages/api/daysbooked.ical.tsx @@ -13,8 +13,11 @@ export default async function useHandler( const bookings = await getBookings() const ical = generateBookedCalendar(bookings) res.statusCode = 200 - //res.set('Content-Type', 'text/calendar;charset=utf-8') - //res.set('Content-Disposition', 'attachment; filename="pfadi-bussle.ics"') + res.setHeader('Content-Type', 'text/calendar;charset=utf-8') + res.setHeader( + 'Content-Disposition', + 'attachment; filename="pfadi-bussle.ics"' + ) res.send(ical) break default: