Skip to content

Commit 0f1afd1

Browse files
committed
fix: return raw calendar with proper headers
1 parent 704ac19 commit 0f1afd1

File tree

1 file changed

+10
-8
lines changed
  • routes/calendar/calendar

1 file changed

+10
-8
lines changed

routes/calendar/calendar/get.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ module.exports = function (options) {
5353
return build(multistatus([responseObj]));
5454
}
5555

56-
// text/calendar
57-
// application/ics
58-
// text/x-vcalendar
59-
// application/octet-stream
56+
// Return raw iCalendar with proper headers
57+
ctx.status = 200;
58+
ctx.remove('DAV');
59+
ctx.set('Content-Type', 'text/calendar; charset=utf-8');
60+
ctx.set('ETag', options.data.getETag(ctx, calendar));
6061
return ics;
6162
}
6263

@@ -89,10 +90,11 @@ module.exports = function (options) {
8990
return build(multistatus([responseObj]));
9091
}
9192

92-
// text/calendar
93-
// application/ics
94-
// text/x-vcalendar
95-
// application/octet-stream
93+
// Return raw iCalendar with proper headers
94+
ctx.status = 200;
95+
ctx.remove('DAV');
96+
ctx.set('Content-Type', 'text/calendar; charset=utf-8');
97+
ctx.set('ETag', options.data.getETag(ctx, calendar));
9698
return ics;
9799
};
98100

0 commit comments

Comments
 (0)