diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index 6d02ad0ab5..bc1f94a7c5 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 6ce28bf1a8..73cf58ec27 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());