This commit is contained in:
syuilo
2021-12-26 12:08:22 +09:00
parent d53795184c
commit cfd1888969
4 changed files with 9 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ import { createTemp } from '@/misc/create-temp';
import { downloadUrl } from '@/misc/download-url';
import { detectType } from '@/misc/get-file-info';
import { StatusError } from '@/misc/fetch';
import { FILE_TYPE_WHITELIST } from '@/const';
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;
@@ -19,7 +19,7 @@ export async function proxyMedia(ctx: Koa.Context) {
const { mime, ext } = await detectType(path);
if (!FILE_TYPE_WHITELIST.includes(mime)) throw 403;
if (!FILE_TYPE_BROWSERSAFE.includes(mime)) throw 403;
let image: IImage;