revert d53795184
This commit is contained in:
@@ -6,7 +6,6 @@ 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_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 +18,7 @@ export async function proxyMedia(ctx: Koa.Context) {
|
||||
|
||||
const { mime, ext } = await detectType(path);
|
||||
|
||||
if (!FILE_TYPE_BROWSERSAFE.includes(mime)) throw 403;
|
||||
if (!mime.startsWith('image/')) throw 403;
|
||||
|
||||
let image: IImage;
|
||||
|
||||
|
Reference in New Issue
Block a user