mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-03-04 07:18:50 -07:00
feat: #9614
This commit is contained in:
parent
d6e40ed77d
commit
fa960711ae
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…
Add table
Reference in a new issue