caldav-adapter 8.0.2 → 8.0.4
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/common/parse-body.js
CHANGED
|
@@ -9,16 +9,18 @@ module.exports = async function (ctx) {
|
|
|
9
9
|
});
|
|
10
10
|
} catch (err) {
|
|
11
11
|
// <https://github.com/stream-utils/raw-body/blob/f62e660e7c50891844f5615de075ab145c1f6129/README.md?plain=1#L82-L116>
|
|
12
|
-
if (ctx
|
|
13
|
-
else
|
|
12
|
+
if (ctx.logger) ctx.logger.warn(err);
|
|
13
|
+
else if (ctx?.app?.emit) ctx.app.emit('error', err, ctx);
|
|
14
|
+
else console.warn(err);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
if (ctx.request.type.includes('xml')) {
|
|
17
18
|
try {
|
|
18
19
|
ctx.request.xml = new DOMParser().parseFromString(ctx.request.body);
|
|
19
20
|
} catch (err) {
|
|
20
|
-
if (ctx
|
|
21
|
-
else
|
|
21
|
+
if (ctx.logger) ctx.logger.warn(err);
|
|
22
|
+
else if (ctx?.app?.emit) ctx.app.emit('error', err, ctx);
|
|
23
|
+
else console.warn(err);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
};
|
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.0.
|
|
4
|
+
"version": "8.0.4",
|
|
5
5
|
"author": "Sanders DeNardi and Forward Email LLC",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Sanders DeNardi <sedenardi@gmail.com> (http://www.sandersdenardi.com/)",
|
|
@@ -66,8 +66,10 @@ module.exports = function (options) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (typeof calMethods[method].exec === 'function') {
|
|
69
|
+
setMultistatusResponse(ctx);
|
|
69
70
|
ctx.body = await calMethods[method].exec(ctx, calendar);
|
|
70
71
|
} else if (typeof calMethods[method] === 'function') {
|
|
72
|
+
setMultistatusResponse(ctx);
|
|
71
73
|
ctx.body = await calMethods[method](ctx, calendar);
|
|
72
74
|
} else {
|
|
73
75
|
log.warn(`method handler not found: ${method}`);
|