remove upload thing (broken anyway)

master
Lauren Liberda 2021-05-17 21:46:59 +02:00
parent 55346005ef
commit 8e1f9558f9
1 changed files with 0 additions and 20 deletions

View File

@ -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) => {