feat: #9614
This commit is contained in:
parent
46d4327fce
commit
68b2dcfd75
2 changed files with 22 additions and 0 deletions
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
router.use(activityPub.routes());
|
||||
router.use(nodeinfo.routes());
|
||||
|
|
Loading…
Reference in a new issue