This commit is contained in:
syuilo
2022-02-03 21:38:57 +09:00
parent b7bbe090e9
commit 508af8d458
3 changed files with 38 additions and 21 deletions

View File

@@ -11,6 +11,11 @@ import { FILE_TYPE_BROWSERSAFE } from '@/const';
export async function proxyMedia(ctx: Koa.Context) {
const url = 'url' in ctx.query ? ctx.query.url : 'https://' + ctx.params.url;
if (typeof url !== 'string') {
ctx.status = 400;
return;
}
// Create temp file
const [path, cleanup] = await createTemp();