refactor
This commit is contained in:
parent
b7bbe090e9
commit
508af8d458
3 changed files with 38 additions and 21 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue