remove invalid route handling

master
lauren n. liberda 2023-04-21 16:40:33 +02:00
parent fe4e737082
commit f53eef62de
No known key found for this signature in database
GPG Key ID: 734C629FD04BD319
1 changed files with 0 additions and 20 deletions

View File

@ -166,25 +166,5 @@ media.get('/thumbnail/:serverName/:mediaId', async (ctx) => {
router.use('/media/r0', media.routes(), media.allowedMethods());
router.all('/:idc+', async (ctx) => {
const req = await got(DEST_SERVER + ctx.path + '?' + ctx.querystring, {
// @ts-ignore
method: ctx.req.method,
body: ctx.body,
responseType: 'buffer',
headers: {
Authorization: ctx.headers['authorization'],
},
});
ctx.res.statusCode = req.statusCode;
Object.keys(req.headers).forEach((h) => {
const val = req.headers[h];
if (typeof val === 'undefined') return;
ctx.res.setHeader(h, val);
});
ctx.res.write(req.body);
ctx.res.end();
});
koa.use(router.routes()).use(router.allowedMethods());
koa.listen(parseInt(LISTENING_PORT || '8009', 10));