Skip to content

Commit

Permalink
image以外はproxyしないように (#5051)
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 authored and syuilo committed Jun 14, 2019
1 parent e9dc54c commit 67dda01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/proxy/proxy-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 67dda01

Please sign in to comment.