This commit is contained in:
cutestnekoaqua 2023-02-13 15:12:04 +01:00
parent 46d4327fce
commit 68b2dcfd75
No known key found for this signature in database
GPG key ID: 6BF0964A5069C1E0
2 changed files with 22 additions and 0 deletions

View file

@ -68,6 +68,17 @@ mastoRouter.use(
}), }),
); );
mastoRouter.use(async (ctx, next) => {
if (ctx.request.query) {
if (!ctx.request.body || Object.keys(ctx.request.body).length === 0) {
ctx.request.body = ctx.request.query
} else {
ctx.request.body = {...ctx.request.body, ...ctx.request.query}
}
}
await next();
});
apiMastodonCompatible(mastoRouter); apiMastodonCompatible(mastoRouter);
/** /**

View file

@ -78,6 +78,17 @@ mastoRouter.use(
}), }),
); );
mastoRouter.use(async (ctx, next) => {
if (ctx.request.query) {
if (!ctx.request.body || Object.keys(ctx.request.body).length === 0) {
ctx.request.body = ctx.request.query
} else {
ctx.request.body = {...ctx.request.body, ...ctx.request.query}
}
}
await next();
});
// Routing // Routing
router.use(activityPub.routes()); router.use(activityPub.routes());
router.use(nodeinfo.routes()); router.use(nodeinfo.routes());