From 8e1f9558f9d1ed7f38eb6d920b262056d8213c8d Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Mon, 17 May 2021 21:46:59 +0200 Subject: [PATCH] remove upload thing (broken anyway) --- src/index.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7703e70..92394e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -146,26 +146,6 @@ media.get('/thumbnail/:serverName/:mediaId', async (ctx) => { } }); -media.post('/upload', async (ctx) => { - for (let retry = 0; retry < 15; retry += 1) { - const res = await got.post(`${DEST_SERVER}/_matrix/media/r0/upload`, { - body: ctx.body, - headers: { - authorization: ctx.headers['authorization'], - 'content-type': ctx.headers['content-type'], - }, - responseType: 'buffer', - }); - if (res.statusCode === 200) { - ctx.res.statusCode = 200; - ctx.res.setHeader('content-type', 'application/json'); - ctx.res.write(res.body); - ctx.res.end(); - return; - } - } -}); - router.use('/media/r0', media.routes(), media.allowedMethods()); router.all('/:idc+', async (ctx) => {