remove upload thing (broken anyway)
parent
55346005ef
commit
8e1f9558f9
20
src/index.ts
20
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) => {
|
||||
|
|
Loading…
Reference in New Issue