caldav-adapter 8.2.7 → 8.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/routes/calendar/calendar/get.js +41 -36
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caldav-adapter",
|
|
3
3
|
"description": "CalDAV server for Node.js and Koa. Modernized and maintained for Forward Email.",
|
|
4
|
-
"version": "8.2.
|
|
4
|
+
"version": "8.2.9",
|
|
5
5
|
"author": "Sanders DeNardi and Forward Email LLC",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Sanders DeNardi <sedenardi@gmail.com> (http://www.sandersdenardi.com/)",
|
|
@@ -39,26 +39,29 @@ module.exports = function (options) {
|
|
|
39
39
|
|
|
40
40
|
const ics = await options.data.buildICS(ctx, events, calendar);
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return build(multistatus([responseObj]));
|
|
42
|
+
if (
|
|
43
|
+
ctx.accepts('text/calendar') ||
|
|
44
|
+
ctx.accepts('application/ics') ||
|
|
45
|
+
ctx.accepts('text/x-vcalendar') ||
|
|
46
|
+
ctx.accepts('application/octet-stream')
|
|
47
|
+
) {
|
|
48
|
+
ctx.status = 200;
|
|
49
|
+
ctx.remove('DAV');
|
|
50
|
+
ctx.set('Content-Type', 'text/calendar; charset=utf-8');
|
|
51
|
+
ctx.set('ETag', options.data.getETag(ctx, calendar));
|
|
52
|
+
return ics;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
//
|
|
57
|
-
ctx.status
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
// xml
|
|
56
|
+
const responseObj = response(ctx.url, status[200], [
|
|
57
|
+
{
|
|
58
|
+
'D:getetag': options.data.getETag(ctx, calendar)
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
'CAL:calendar-data': encodeXMLEntities(ics)
|
|
62
|
+
}
|
|
63
|
+
]);
|
|
64
|
+
return build(multistatus([responseObj]));
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
const event = await options.data.getEvent(ctx, {
|
|
@@ -76,26 +79,28 @@ module.exports = function (options) {
|
|
|
76
79
|
|
|
77
80
|
const ics = await options.data.buildICS(ctx, event, calendar);
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return build(multistatus([responseObj]));
|
|
82
|
+
if (
|
|
83
|
+
ctx.accepts('text/calendar') ||
|
|
84
|
+
ctx.accepts('application/ics') ||
|
|
85
|
+
ctx.accepts('text/x-vcalendar') ||
|
|
86
|
+
ctx.accepts('application/octet-stream')
|
|
87
|
+
) {
|
|
88
|
+
ctx.status = 200;
|
|
89
|
+
ctx.remove('DAV');
|
|
90
|
+
ctx.set('Content-Type', 'text/calendar; charset=utf-8');
|
|
91
|
+
ctx.set('ETag', options.data.getETag(ctx, calendar));
|
|
92
|
+
return ics;
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
const responseObj = response(ctx.url, status[200], [
|
|
96
|
+
{
|
|
97
|
+
'D:getetag': options.data.getETag(ctx, calendar)
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
'CAL:calendar-data': encodeXMLEntities(ics)
|
|
101
|
+
}
|
|
102
|
+
]);
|
|
103
|
+
return build(multistatus([responseObj]));
|
|
99
104
|
};
|
|
100
105
|
|
|
101
106
|
return {
|