From 2c2de1282ad35af9e574a2df55097decf051ce53 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 14 Jun 2019 12:14:23 +0900 Subject: [PATCH] =?UTF-8?q?image=E4=BB=A5=E5=A4=96=E3=81=AFproxy=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=20(#5051)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/proxy/proxy-media.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/proxy/proxy-media.ts b/src/server/proxy/proxy-media.ts index 357715bb9202..84d30b04a4c9 100644 --- a/src/server/proxy/proxy-media.ts +++ b/src/server/proxy/proxy-media.ts @@ -17,6 +17,8 @@ export async function proxyMedia(ctx: Koa.BaseContext) { const [type, ext] = await detectMine(path); + if (!type.startsWith('image/')) throw 403; + let image: IImage; if ('static' in ctx.query && ['image/png', 'image/gif'].includes(type)) {