caldav-adapter 7.0.5 → 7.0.6

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 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": "7.0.5",
4
+ "version": "7.0.6",
5
5
  "author": "Sanders DeNardi and Forward Email LLC",
6
6
  "contributors": [
7
7
  "Sanders DeNardi <sedenardi@gmail.com> (http://www.sandersdenardi.com/)",
@@ -14,19 +14,18 @@ module.exports = function (options) {
14
14
  fullData: true
15
15
  });
16
16
 
17
- if (ctx.accepts('xml')) {
18
- const ics = await options.data.buildICS(ctx, events, calendar);
19
- return response(ctx.url, status[200], [
20
- {
21
- 'D:getetag': options.data.getETag(ctx, calendar)
22
- },
23
- {
24
- 'CAL:calendar-data': ics
25
- }
26
- ]);
27
- }
17
+ if (ctx.accepts('text/calendar'))
18
+ return options.data.buildICS(ctx, events, calendar);
28
19
 
29
- return options.data.buildICS(ctx, events, calendar);
20
+ const ics = await options.data.buildICS(ctx, events, calendar);
21
+ return response(ctx.url, status[200], [
22
+ {
23
+ 'D:getetag': options.data.getETag(ctx, calendar)
24
+ },
25
+ {
26
+ 'CAL:calendar-data': ics
27
+ }
28
+ ]);
30
29
  }
31
30
 
32
31
  const event = await options.data.getEvent(ctx, {
@@ -42,21 +41,20 @@ module.exports = function (options) {
42
41
  return;
43
42
  }
44
43
 
45
- if (ctx.accepts('xml')) {
46
- const ics = await options.data.buildICS(ctx, event, calendar);
47
- return response(ctx.url, status[200], [
48
- {
49
- // TODO: should E-Tag here be of calendar or event?
50
- // 'D:getetag': options.data.getETag(ctx, calendar)
51
- 'D:getetag': options.data.getETag(ctx, calendar)
52
- },
53
- {
54
- 'CAL:calendar-data': ics
55
- }
56
- ]);
57
- }
58
-
59
- return options.data.buildICS(ctx, event, calendar);
44
+ if (ctx.accepts('text/calendar'))
45
+ return options.data.buildICS(ctx, event, calendar);
46
+
47
+ const ics = await options.data.buildICS(ctx, event, calendar);
48
+ return response(ctx.url, status[200], [
49
+ {
50
+ // TODO: should E-Tag here be of calendar or event?
51
+ // 'D:getetag': options.data.getETag(ctx, calendar)
52
+ 'D:getetag': options.data.getETag(ctx, calendar)
53
+ },
54
+ {
55
+ 'CAL:calendar-data': ics
56
+ }
57
+ ]);
60
58
  };
61
59
 
62
60
  return {