From 980d44756179d5c65f65c0e86c602513064a9305 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 1 Mar 2023 15:53:40 +0100 Subject: [PATCH] parse full multipart data to media endpoints --- packages/backend/src/server/api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index 752303e95f..96b03a4f66 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -82,7 +82,7 @@ mastoFileRouter.post("/v1/media", upload.single("file"), async (ctx) => { ctx.status = 401; return; } - const data = await client.uploadMedia(multipartData.buffer); + const data = await client.uploadMedia(multipartData); ctx.body = data.data; } catch (e: any) { console.error(e); @@ -101,7 +101,7 @@ mastoFileRouter.post("/v2/media", upload.single("file"), async (ctx) => { ctx.status = 401; return; } - const data = await client.uploadMedia(multipartData.buffer); + const data = await client.uploadMedia(multipartData); ctx.body = data.data; } catch (e: any) { console.error(e);