diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index 6d02ad0ab..bc1f94a7c 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -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); /** diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 6ce28bf1a..73cf58ec2 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -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());