From 0758e38237419d84deba83837570841aeb0bb34e Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sun, 24 Sep 2023 21:45:00 +0200 Subject: [PATCH] upd: masto api support more types --- .../src/server/api/mastodon/MastodonApiServerService.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index ed56963156..36164e9682 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -1,5 +1,6 @@ import { Inject, Injectable } from '@nestjs/common'; import megalodon, { Entity, MegalodonInterface } from 'megalodon'; +import multipart from '@fastify/multipart'; import { IsNull } from 'typeorm'; import multer from 'fastify-multer'; import type { UsersRepository } from '@/models/_.js'; @@ -42,6 +43,13 @@ export class MastodonApiServerService { fastify.register(multer.contentParser); + fastify.register(multipart, { + limits: { + fileSize: this.config.maxFileSize ?? 262144000, + files: 1, + }, + }); + fastify.get('/v1/custom_emojis', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization;